Commands
#1

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;
    }
}
Reply
#2

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;
    }
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)