Need help with payfare command
#4

Quote:
Originally Posted by IceBilizard
Посмотреть сообщение
Hmm well its not possible because in my script have almost 200+ command with strcmp
You can, just read this:
http://forum.sa-mp.com/showpost.php?...7&postcount=16

Furthermore, even wiki states that strtok is a deprecated function, and it should be avoided in most of the cases

Here's an example:

pawn Код:
public OnPlayerCommandPerformed(playerid, cmdtext[], success)//Replace OnPlayerCommandText with this callback
{
    if(success)
    {
        return 1;
    }
    //Place all your strcmp commands here:
    if(strcmp(cmdtext, "/help", true) == 0)
    {
        SendClientMessage(playerid, -1, "Available commands: ");
        return 1;
    }

    if(strcmp(cmdtext, "/kill", true) == 0)
    {
        SetPlayerHealth(playerid, 0);
        return 1;
    }

    return 0;
}
//Now you can make a zcmd command outside that callback:

CMD:hi(playerid, params[])
{
    SendClientMessage(playerid, -1, "Hello World.");
    return 1;
}
Reply


Messages In This Thread
Need help with payfare command - by IceBilizard - 30.08.2014, 16:50
Re: Need help with payfare command - by ThePhenix - 30.08.2014, 16:53
Re: Need help with payfare command - by IceBilizard - 30.08.2014, 16:55
Re: Need help with payfare command - by ThePhenix - 30.08.2014, 16:56

Forum Jump:


Users browsing this thread: 1 Guest(s)