SA-MP Forums Archive
Commands - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Commands (/showthread.php?tid=228801)



Commands - Rock18 - 20.02.2011

Hey , how i can make this 2 commands with zcmd+sscanf ? i've tryed but didn't work

Код:
if(strcmp(cmd, "/getvip", true) == 0)
{
    new vippp;
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp)) return SendClientMessage(playerid, 0xF60000AA, "Use /getvip [id].");
    vippp = strval(tmp);
    if(IsPlayerConnected(vippp)) {
        GetPlayerVip(vippp);
        SendClientMessage(playerid, 0xF60000AA, "He is not a vip anymore");
        SendClientMessage(vippp, 0xF60000AA, "You are not a vip anymore");
        return 1;
    }
    else {
        SendClientMessage(playerid, COLOR_RED, "player off :(");
        return 1;
    }
}
and
Код:
if(strcmp(cmd, "/setvip", true) == 0)
{
    new vippp;
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp)) return SendClientMessage(playerid, 0xF60000AA, "Use /setvip [id].");

    vippp = strval(tmp);
    if(IsPlayerConnected(vippp)) {
        SetPlayerVip(vippp);
        SendClientMessage(playerid, 0xF60000AA, "Player set as vip");
        SendClientMessage(vippp, 0xF60000AA, "You are now vip");
        return 1;
    }
    else {
        SendClientMessage(playerid, COLOR_RED, "player off :(");
        return 1;
    }
}



Re: Commands - MadeMan - 20.02.2011

pawn Код:
CMD:setvip(playerid, params[])
{
    new vippp;
    if(sscanf(params, "u", vippp)) return SendClientMessage(playerid, 0xF60000AA, "Use /setvip [id].");
    if(IsPlayerConnected(vippp)) {
        SetPlayerVip(vippp);
        SendClientMessage(playerid, 0xF60000AA, "Player set as vip");
        SendClientMessage(vippp, 0xF60000AA, "You are now vip");
        return 1;
    }
    else {
        SendClientMessage(playerid, COLOR_RED, "player off :(");
        return 1;
    }
}