Sscanf
#5

Don't use "i" for player name, use "u" or "r". With that you can either put a part of the player's name, or their ID. Try the code below.
pawn Код:
dcmd_cage(playerid,params[])
{
    if(AccInfo[playerid][Level] < 2)
    return ErrorMessages(playerid, 5);

    new id,string[128];
    if(sscanf(params,"us",id,params)) return SendClientMessage(playerid, COLOR_GREEN,"USAGE: /cage [PlayerId] [reason]");
    if(!IsPlayerConnected(id)) return SendClientMessage(playerid,COLOR_GREEN,"The Player is not connected!");
    new pName[MAX_PLAYER_NAME];
    new vName[MAX_PLAYER_NAME];
    GetPlayerName(playerid,pName,32);
    GetPlayerName(id,vName,32);
    CagePlayer(id);
    format(string,sizeof string,"** ADMIN CAGE: %s has been caged - %s",vName,params);
    SendClientMessageToAll(adminpink,string);
    return 1;
}
Reply


Messages In This Thread
Sscanf - by SnG.Scot_MisCuDI - 23.12.2011, 04:57
Re: Sscanf - by [ABK]Antonio - 23.12.2011, 05:34
Re: Sscanf - by SnG.Scot_MisCuDI - 23.12.2011, 18:35
Re: Sscanf - by [ABK]Antonio - 23.12.2011, 18:40
Re: Sscanf - by Tee - 23.12.2011, 18:40
Respuesta: Sscanf - by kirk - 23.12.2011, 18:41
Re: Sscanf - by SnG.Scot_MisCuDI - 23.12.2011, 18:46
Re: Sscanf - by [ABK]Antonio - 23.12.2011, 18:49
Re: Sscanf - by Tee - 23.12.2011, 19:09

Forum Jump:


Users browsing this thread: 3 Guest(s)