Again problem with sscanf + zcmd
#4

Untested, but it should work:
pawn Код:
command(cuff, playerid, params[])
{
    new x_nr[4], string[128], giveplayerid;
    if(sscanf(params,"su",x_nr,giveplayerid)) return SendClientMessage(playerid, baltakrasa, "Sintakse: /cuff <on/off> <speletaja id/vards>.");
    if(giveplayerid != INVALID_PLAYER_ID)
    {
        if(strcmp(x_nr,"on",true) == 0)
        {
            TogglePlayerControllable(giveplayerid, 0);
            format(string, sizeof(string), "Informacija: %s tevi sasledza rokudzelћos.", GetName(id));
            SendClientMessage(giveplayerid, baltakrasa, string);
            format(string, sizeof(string), "Informacija: Tu sasledzi %s rokudzelћos.", GetName(playerid));
            SendClientMessage(playerid, baltakrasa, string);
        }
        else if(strcmp(x_nr,"off",true) == 0)
        {
            TogglePlayerControllable(giveplayerid, 1);
            format(string, sizeof(string), "Informacija: %s tevi atbrivoja no rokudzelћiem.", GetName(id));
            SendClientMessage(giveplayerid, baltakrasa, string);
            format(string, sizeof(string), "Informacija: Tu atbrivoji %s no rokudzelћiem.", GetName(playerid));
            SendClientMessage(playerid, baltakrasa, string);
        }
    } else SendClientMessage(playerid, baltakrasa, "Invalid player");
    return 1;
}
Reply


Messages In This Thread
Again problem with sscanf + zcmd - by KotoK - 04.02.2011, 08:35
Re: Again problem with sscanf + zcmd - by YungGee - 04.02.2011, 09:02
Re: Again problem with sscanf + zcmd - by KotoK - 04.02.2011, 09:42
Re: Again problem with sscanf + zcmd - by xxmitsu - 04.02.2011, 09:48

Forum Jump:


Users browsing this thread: 1 Guest(s)