02.01.2013, 21:18
pawn Код:
dcmd_warn(playerid,params[])
{
new string[128], giveplayerid, giveplayer[MAX_PLAYER_NAME], cmdreason[64];
if(PlayerInfo[playerid][pAdmin] >= 1)
{
if(sscanf(params,"us[64]", giveplayerid, cmdreason)) SendClientMessage(playerid,COLOR_NUB,"USAGE: /warn <ID> <Reason>");
if(giveplayerid == INVALID_PLAYER_ID)
{
/*
This area, if the player is not connected? How can it show the ID? So you can just delete the '[%i]' and the '%s' if he's not online.
format(string,sizeof(string),"The player ID %s[%i] is not connected to the server. You cannot warn him.",giveplayer,giveplayerid);
SendClientMessage(playerid,COLOR_NUB,string);
*/
format(string,sizeof(string),"The player ID is not connected to the server. You cannot warn him.",giveplayer,giveplayerid);
SendClientMessage(playerid,COLOR_NUB,string);
return 1;
}
GetPlayerName(giveplayerid, giveplayer, siezof(giveplayer));
format(string,sizeof(string),"{FFFFFF}__**Punished**__{FFFFFF} %s(%d) Has been warned. {FFFFFF}Reason: %s{FFFFFF}",giveplayer,giveplayerid,cmdreason);
SendClientMessageToAll(-1,string);
}
else SendClientMessage(playerid, -1, "You're not authorized to use this command!");
return 1;
}