Multiple Param Commands with SSCANF
#3

pawn Код:
CMD:faction(playerid, params[])
{
    new string[128], pID, rank, option[35], msgbox[128];
    if(PlayerInfo[playerid][Faction] == 0) return SendClientMessage(playerid, COLOR_ADMIN_GM, "You aren't in any faction!");
    if(sscanf(params, "s[128]", option)) return SendClientMessage(playerid, COLOR_ADMIN_GM, "USAGE: /faction [params]");
    if(!strcmp(option, "invite"))
    {
        if(sscanf(params, "{s[10]}r", pID)) return SendClientMessage(playerid, COLOR_ADMIN_GM, "USAGE: /faction invite [playerid]");
        else if(!IsPlayerConnected(pID)) return SendClientMessage(playerid, COLOR_ADMIN_GM, "Error: 65535 Invalid playerid!");
        else
        {
        printf("Debug, 'invite' pID: %s", pID);
        }
    }
    else if(!strcmp(option, "uninvite"))
    {
       if(sscanf(params, "{s[10]}r", pID)) return SendClientMessage(playerid, COLOR_ADMIN_GM, "USAGE: /faction uninvite [playerid]");
        else if(!IsPlayerConnected(pID)) return SendClientMessage(playerid, COLOR_ADMIN_GM, "Error: 65535 Invalid playerid!");
        else
        {
        print("Uninvite");
        printf("DEBUG 'uninvite' ID: %d", pID);
        }
    }
    return 1;
}
Reply


Messages In This Thread
Multiple Param Commands with SSCANF - by FalconWingsX - 17.12.2013, 18:17
Re: Multiple Param Commands with SSCANF - by Joe Staff - 17.12.2013, 18:22
Re: Multiple Param Commands with SSCANF - by FalconWingsX - 17.12.2013, 18:25
Re: Multiple Param Commands with SSCANF - by Hansrutger - 17.12.2013, 18:42
Re: Multiple Param Commands with SSCANF - by FalconWingsX - 17.12.2013, 18:53
Re: Multiple Param Commands with SSCANF - by Hansrutger - 17.12.2013, 19:00
Re: Multiple Param Commands with SSCANF - by FalconWingsX - 19.12.2013, 20:30
AW: Multiple Param Commands with SSCANF - by Nero_3D - 19.12.2013, 21:41
Re: AW: Multiple Param Commands with SSCANF - by Patrick - 19.12.2013, 21:44

Forum Jump:


Users browsing this thread: 1 Guest(s)