It is working. Before you i was using self which only really works client side but in that case could not work. Localcmd sends the command to the server. Which allows you to see if if you are the local server/client or from the server console. You are correct that the client would not be able to see it but it doesn't make any sense for the client to see it. What we are doing here isn't meant to be done the way you are doing it. I already gave you a function that will make the aliases automatically from an array. Then I gave you a function that will look for a command to be used. Then would run a specific function depending on the situation. This isn't the best way to send visible commands to the client anyway. I thought you were simply trying to test that this was indeed allowing for code to execute which from what I can tell we have established that is does. This isn't the normal means it which you would send a message to the player that would print on the client screen. If you want things like sprint, centerprint, etc to be sent to the player you'll have to do it in something like postthink or putclientinserver from client.qc. This type of function we are trying to do happens only on the server side. So it has no way to identify the player as self or whatever so those type of commands will not work even if sent to the player. dprint only works in code with to a self or other, etc. So it can only work on a entity. Which means in this case it wouldn't be able to spit anything out. The type of functions I am sending you to use for this are not setup to send messages to the players screens. We would load this code in a completely different place if we were accomplishing this. But the localcmd example did let you see it while in the server console or in game if you are the local server. Like I said, if we've already tested that the code works so I don't see the issue.
is any of this making sense? Think of how your MOTD works now. See how the code is placed in a location where it can be called to the player? It works because the check for it is placed in PostThink of the player in client.qc. Which means we can use self. and thus can assign the command to an entity. Like I said, commands like sprint, centerprint, etc require this and thus cannot be run via world.qc in a function like startframe because it has no frame of reference to assign a self.
Again, all of the code I gave above works server side via the startframe () in world.qc. It has nothing to do with the client per say. It just sets up everything that the client will use. Like impulses, this temp1 command, and aliases. All of those things can be sent to the client via various means without the need for the code to be placed in client.qc or in reference to an entity. If we wanted to we could even create an entity to use server side. But in this case it's just simply not needed.
I think we both just got confused about what you are trying to do. But obviously the code works but you are trying to use it in an in correct way.
is any of this making sense? Think of how your MOTD works now. See how the code is placed in a location where it can be called to the player? It works because the check for it is placed in PostThink of the player in client.qc. Which means we can use self. and thus can assign the command to an entity. Like I said, commands like sprint, centerprint, etc require this and thus cannot be run via world.qc in a function like startframe because it has no frame of reference to assign a self.
Again, all of the code I gave above works server side via the startframe () in world.qc. It has nothing to do with the client per say. It just sets up everything that the client will use. Like impulses, this temp1 command, and aliases. All of those things can be sent to the client via various means without the need for the code to be placed in client.qc or in reference to an entity. If we wanted to we could even create an entity to use server side. But in this case it's just simply not needed.
I think we both just got confused about what you are trying to do. But obviously the code works but you are trying to use it in an in correct way.
Comment