Home   Help Search Login Register  

Author Topic: How do i use selectplayer commands using player names  (Read 1442 times)

0 Members and 1 Guest are viewing this topic.

Offline BATTLE-TOAD

  • Members
  • *
I want to create a script(s) that will allow me to get a player's individual name such as "BATTLE TOAD" and use it as a global or local variable so that I can reference it later in another related script that will have SELECTPLAYER commands.

If I have SELECTPLAYER commands in a script it's going to execute for all players correct?
I need to execute selectplayer for just individual players.

Instead of using a UAV logic for the ptchela-1t (UAV)  I am using some functions via player addaction that will create a unit named DUMMY and place him in the driver position of the uav then the script will check that the uav is alive and that DUMMY is in the driver postion of the uav and finaly the command "selectplayer dummy" is given.  If the uav is not alive or dummy is not in driver postion then player group chat will just say something like "UAV is unavailable".

So now the player is in control of "DUMMY" and the AI has taken control of his original unit, we'll call "west1"

eventualy dummy and/or the uav will be destroyed, This is when I want the player to regain control over the previous unit he was in control of: "west1".

however, giving the command "selectplayer west1" is going to apply to all players on the server.

I want to get the player's name (ie "BATTLE TOAD") at the beginning of the script or perhaps upon executing the addaction so i can then tell "BATTLE TOAD" to selectplayer "west1" when a condition such as: "!alive dummy" has been met.

this will simulate remote control over the uav in the same way the uav logic does. except the player now has full control to maneuver and fire weapons (it has a gbu and machinegun lol).

when the player controled uav is destroyed the player in fact does not die because he is automaticaly switched to another unit that is still alive and therefore no death was recorded.

as soon as the player is switched back to his original unit, dummy is deleted and then recreated and placed back in the driver position of the uav as soon as it too is recreated.


UPDATE: I guess to summarize, I need to know if/how selectplayer can be executed on a player's computer only and not the entire server. What I have made as of today might work but it would be impossible to test it by myself so it has to be done on paper.

« Last Edit: 27 Jul 2009, 22:12:06 by BATTLE-TOAD »