how do i make strcmp params?
#6

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext, "/setscore", true))
    {
        if(!IsPlayerAdmin) return 0;
        new tmp[128];
        tmp = strtok(cmdtext,idx);
        if(!strlen(tmp)) return SendClientMessage(playerid,-1,"Usage: /setscore [ID] [SCORE]");
        if(!IsPlayerConnected(tmp)) return SendClientMessage(playerid,-1,"Player not found.");
        new id = strval(tmp);
        tmp = strtok(cmdtext,idx);
        if(!strlen(tmp)) return SendClientMessage(playerid,-1,"Usage: /setscore [ID] [SCORE]");
        SetPlayerScore(id,tmp);
        return 1;
    }
    return 0;
}
Made now, not tested.
Like this?
Reply


Messages In This Thread
how do i make strcmp params? - by (_AcE_) - 01.04.2013, 20:35
Re: how do i make strcmp params? - by [CG]Milito - 01.04.2013, 20:42
Re: how do i make strcmp params? - by Konstantinos - 01.04.2013, 20:45
Re: how do i make strcmp params? - by kamzaf - 01.04.2013, 20:49
Re: how do i make strcmp params? - by (_AcE_) - 01.04.2013, 20:53
Re: how do i make strcmp params? - by zxc1 - 01.04.2013, 20:55
Re: how do i make strcmp params? - by (_AcE_) - 01.04.2013, 21:05
Re: how do i make strcmp params? - by zxc1 - 01.04.2013, 22:22
Re: how do i make strcmp params? - by (_AcE_) - 01.04.2013, 23:30
Re: how do i make strcmp params? - by zxc1 - 02.04.2013, 09:09

Forum Jump:


Users browsing this thread: 1 Guest(s)