How to...
#1

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?
Reply
#2

Using sscanf

pawn Код:
CMD:jobpermission (playerid, params[])
{
    new ID;
    if(sscanf(params, "u", ID))
        return SendClientMessage(playerid, -1, "/jobpermission [ID]");

    //Command
    return true;
}
Reply
#3

uhm, okay. Wouldn't
pawn Код:
if(!strlen(params)) return SendErrorMessage(playerid, "USAGE: /jobpermission [ID]");
Work though?
Reply
#4

Does your command set someones job?
Reply
#5

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.
Reply
#6

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;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)