GamerDeMTA Posted June 7, 2013 Posted June 7, 2013 Hi I want to do this !!! something like this a command for do the function BUUUT For the user I say! Check1 if the command is /fuck, i must say /fuck GamerDeMTA for do the function to me! how to do that
Castillo Posted June 7, 2013 Posted June 7, 2013 I really don't understand, you want to output when the player uses a command, and which commnd is that? addEventHandler ( "onPlayerCommand", root, function ( cmd ) outputChatBox ( getPlayerName ( source ) .." used the command /".. cmd ) end ) San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
GamerDeMTA Posted June 7, 2013 Author Posted June 7, 2013 ah, imagine the command is /banh how to do that the function goes to the user? For example, with /mute it's the same. I want to do it like that. For example, /warptosanfierro ..
Castillo Posted June 7, 2013 Posted June 7, 2013 addCommandHandler ( "hello", function ( thePlayer, _, who ) local playerWho = getPlayerFromName ( who ) -- Get the player from the string entered on the command. if ( playerWho ) then -- If the player really exists... outputChatBox ( getPlayerName ( thePlayer ) .." says hello!", playerWho ) -- Output a chatbox message to him. end end ) San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
GamerDeMTA Posted June 7, 2013 Author Posted June 7, 2013 i think u dont understand me I mean, for example, when I write /tep GamerDeMTA, GamerDeMTA gets the function for the commandhandler. For example, GamerDeMTA is warped to somewhere. If I write /tep Castillo, then Castillo goes... Understand ¿?
Castillo Posted June 7, 2013 Posted June 7, 2013 I gave you an example of how to make a command to output a message to the player you fill in the command, now you must change it to do whatever you need. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
GamerDeMTA Posted June 7, 2013 Author Posted June 7, 2013 thanks but i changed sth. and it didnt work for me can u put a example of this? setElementPosition When I say /lv UserName it goes to the Position. [The UserName]
Castillo Posted June 7, 2013 Posted June 7, 2013 Show how you changed it. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
GamerDeMTA Posted June 7, 2013 Author Posted June 7, 2013 addCommandHandler ( "warpt", function ( thePlayer, _, who ) local playerWho = getPlayerFromName ( who ) -- Get the player from the string entered on the command. if ( playerWho ) then -- If the player really exists... setElementPosition ( playerWho, x, y, z ) end end )
LucasBaker Posted June 7, 2013 Posted June 7, 2013 \/ function teleportarPlayer (player, CMD, targetName, thePlayer) local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then if not targetName then outputChatBox("Uso Correto: /tep nick", player) else local target = getPlayerFromName (targetName ) if not target then -- check if the name is valit outputChatBox("ERRO: Jogador não encontra-se online!", player) else local x,y,z = getElementPosition ( target ) setElementPosition ( player,x,y,z+1) --setElementPosition ( player, getElementPosition ( target )) end end end addCommandHandler ( "tep", teleportarPlayer )
GamerDeMTA Posted June 8, 2013 Author Posted June 8, 2013 \/ function teleportarPlayer (player, CMD, targetName, thePlayer) local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then if not targetName then outputChatBox("Uso Correto: /tep nick", player) else local target = getPlayerFromName (targetName ) if not target then -- check if the name is valit outputChatBox("ERRO: Jogador não encontra-se online!", player) else local x,y,z = getElementPosition ( target ) setElementPosition ( player,x,y,z+1) --setElementPosition ( player, getElementPosition ( target )) end end end addCommandHandler ( "tep", teleportarPlayer ) will that do it? why the outputchatboxs?
PaiN^ Posted June 8, 2013 Posted June 8, 2013 addCommandHandler ( "warpt", function ( thePlayer, _, who ) local playerWho = getPlayerFromName ( who ) -- Get the player from the string entered on the command. if ( playerWho ) then -- If the player really exists... setElementPosition ( playerWho, x, y, z ) end end ) Are the "x, y, z" defined smoewhere at the script ? " Keep Thinking Different . " - Steve Jops -------------------- Don't send me PMs asking for help, I Won't reply !
manawydan Posted June 8, 2013 Posted June 8, 2013 try addCommandHandler ( "warpt", function ( thePlayer, _, who ) local playerWho = getPlayerFromName ( who ) if ( playerWho ) then local x, y, z = getElementPosition(playerWho) setElementPosition ( thePlayer, x, y, z ) end end ) "Querer não é poder, mas tentar é avançar"!
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now