How to... - 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: How to... (
/showthread.php?tid=331519)
How to... -
iLcke - 05.04.2012
Using ZCMD, how do you do something like this. I'll just like, give an idea.
You type /jobpermission [ID]
How would you get the ID that the player typed?
Re: How to... -
ViniBorn - 05.04.2012
Using sscanf
pawn Код:
CMD:jobpermission (playerid, params[])
{
new ID;
if(sscanf(params, "u", ID))
return SendClientMessage(playerid, -1, "/jobpermission [ID]");
//Command
return true;
}
Re: How to... -
iLcke - 05.04.2012
uhm, okay. Wouldn't
pawn Код:
if(!strlen(params)) return SendErrorMessage(playerid, "USAGE: /jobpermission [ID]");
Work though?
Re: How to... -
Luis- - 05.04.2012
Does your command set someones job?
Re: How to... -
iLcke - 05.04.2012
Yeah.. But, I just dont know how to use ZCMD to actually get the player's ID, and running it around to actually setting it, ect.
Re: How to... -
DarkScripter - 05.04.2012
you can use SSCANF width ZCMD to get the player's ID's.
pawn Код:
CMD:mycommand(playerid, params[])
{
new interator;
if(ssacnf(params,"i", interator))
return SendClientMessage(playerid, -1,"/mycommand <number>");
new
string[100];
format(string, sizeof(string),"Yoour choose the number %d =)", interator);
SendClientMessage(playerid, -1, string);
return 1;
}