#3

pawn Код:
CMD:jail(playerid, params[])
{
    if(pInfo[playerid][AdminLevel] >= 1) return SendClientMessage(playerid, -1,"{FF0000}[SYSTEM ERROR]: You don't have the privilege to use that command.");
    {
           new id, string[64],reason[100], admin[24], name[24];
           if(sscanf(params, "ds[64]",id, reason)) return SendClientMessage(playerid, -1, "{FF0000}[SYSTEM ERROR]: {FFFFFF}USAGE: /jail [id] [reason]");
           if(!IsPlayerConnected(id)) return SendClientMessage(playerid, -1, "{FF0000}[SYSTEM ERROR]: The ID you have inputted is incorrect");

           SetPlayerInterior(id, 18);
           SetPlayerPos(id, 1710.433715,-1669.379272,20.225049);
           SetPlayerVirtualWorld(id, 10);
           SetPlayerHealth(id, 9999999);
           ResetPlayerWeapons(id);

           GetPlayerName(playerid, admin,sizeof(admin));
           GetPlayerName(id, name, sizeof(name) ) ;
           format(string, sizeof string, "{FF0000}[SYSTEM]: %s has been jailed by %s | Reason: %s", name, admin, reason);
           SendClientMessageToAll(-1, string);
    }
    return 1;
}
EDIT:
pawn Код:
stock GetPlayerNameEx(playerid)
{
     new pName[25];
     GetPlayerName(playerid, pName, sizeof(pName));
     return pName;
}
This function will help you to get the player name more easier later, just with the "player id", example:
pawn Код:
CMD:test( playerid )
{
    new
            str[ 64 ];
    format( str, sizeof( str ) , "Your name is %s", GetPlayerNameEx( playerid ) );
    return true;
}
Reply


Messages In This Thread
Jail - by Glossy42O - 22.07.2015, 17:29
Re: Jail - by DarkLored - 22.07.2015, 17:32
Re: Jail - by SilentSoul - 22.07.2015, 17:33
Re: Jail - by Glossy42O - 22.07.2015, 17:35
Re: Jail - by SilentSoul - 22.07.2015, 17:37
Re: Jail - by DarkLored - 22.07.2015, 17:44
Re: Jail - by Glossy42O - 22.07.2015, 18:31

Forum Jump:


Users browsing this thread: 1 Guest(s)