SA-MP Forums Archive
ZCMD command used by KeyStateChange, help plox - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: ZCMD command used by KeyStateChange, help plox (/showthread.php?tid=473958)



ZCMD command used by KeyStateChange, help plox - Riwerry - 05.11.2013

Hello guys how i can make my zcmd command put into keystate change?
My begin of zcmd cmd

pawn Код:
COMMAND:majak(playerid,cmdtext[])
Thanks


Re: ZCMD command used by KeyStateChange, help plox - Kaperstone - 05.11.2013

I don't understand,you want to put a command in OnPlayerKeyStateChange ?
for what ?


Re: ZCMD command used by KeyStateChange, help plox - Riwerry - 05.11.2013

I want to put my command created by ZCMD to OnPlayerKeyStateChange, so it will use this command when I press some key.


Re: ZCMD command used by KeyStateChange, help plox - IstuntmanI - 05.11.2013

pawn Код:
cmd_majak( playerid, "" ); // under OnPlayerKeyStateChange



Re: ZCMD command used by KeyStateChange, help plox - Riwerry - 05.11.2013

( playerid, "WHAT TO ADD HERE? " );


Re: ZCMD command used by KeyStateChange, help plox - iZN - 05.11.2013

This is not ZCMD to be honest.

COMMAND:majak(playerid,cmdtext[])


Original command:
pawn Код:
COMMAND:majak(playerid, params[]) // if you're not using params, remove params[]
// OR
CMD:majak(playerid, params[])
// OR
command(majak, playerid, params[])
For redirecting the command, you can use
pawn Код:
cmd_majak(playerid, params);



Re: ZCMD command used by KeyStateChange, help plox - Riwerry - 05.11.2013

at redirecting the command can I use cmd_majak(playerid, cmdtext); ? Becouse on my cmd im not using params but cmdtext COMMAND:majak(playerid,cmdtext[])

//Second question, how I can make so player when type /majak this command not work this way? Becouse I want to make this command only with hotkey


Re: ZCMD command used by KeyStateChange, help plox - IstuntmanI - 05.11.2013

You can use it exactly how I gave you the example.

Why ? Then, add the code directly at OnPlayerKeyStateChange, or make a function with that code and call it.


Re: ZCMD command used by KeyStateChange, help plox - Riwerry - 05.11.2013

Well i will try it using params, edited cmdtext to params redirected compiled and got his

C:\Users\Jakub\Desktop\Server\gamemodes\LVRP.pwn(2 79) : error 029: invalid expression, assumed zero
C:\Users\Jakub\Desktop\Server\gamemodes\LVRP.pwn(2 79) : error 017: undefined symbol "params"
C:\Users\Jakub\Desktop\Server\gamemodes\LVRP.pwn(2 79) : error 029: invalid expression, assumed zero
C:\Users\Jakub\Desktop\Server\gamemodes\LVRP.pwn(2 79) : fatal error 107: too many error messages on one line

pawn Код:
COMMAND:majak(playerid, params[])//279 line