Again problem with sscanf + zcmd
#1

pawn Код:
command(cuff, playerid, params[])
{
    new id, x_nr, string[128], giveplayerid;
    if(sscanf(params,"s",x_nr))
        return SendClientMessage(playerid, baltakrasa, "Sintakse: /cuff <on/off> <spēlētāja id/vārds>.");

    if(strcmp(params,"on",true) == 0){
    if(sscanf(params,"ru",id))
        return SendClientMessage(playerid, baltakrasa, "Sintakse: /cuff on <spēlētāja id/vārds>.");

    TogglePlayerControllable(id, 0);
    format(string, sizeof(string), "Informācija: %s tevi saslēdza rokudzelћos.", GetName(id));
    SendClientMessage(id, baltakrasa, string);
    format(string, sizeof(string), "Informācija: Tu saslēdzi %s rokudzelћos.", GetName(playerid));
    SendClientMessage(playerid, baltakrasa, string);}

    else if(strcmp(params,"off",true) == 0){
    if(sscanf(params,"ru",id))
        return SendClientMessage(playerid, baltakrasa, "Sintakse: /cuff off <spēlētāja id/vārds>.");

    TogglePlayerControllable(id, 1);
    format(string, sizeof(string), "Informācija: %s tevi atbrīvoja no rokudzelћiem.", GetName(id));
    SendClientMessage(id, baltakrasa, string);
    format(string, sizeof(string), "Informācija: Tu atbrīvoji %s no rokudzelћiem.", GetName(playerid));
    SendClientMessage(playerid, baltakrasa, string);}
    return 1;
}
When I type /cuff <on or off> <playerid> nothing happens but when I type /cuff <on or off> it freezes/unfreeze me. I need to get work /cuff <on or off> <playerid>. I want you to fix this script. It should work with /cuff <on or off> <playerid> and it needs to freeze/unfreeze typed playerid.
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)