02.01.2013, 19:56
Hai again
I made another command but it's not working correctly (/warn)
How it works?
1)It's supposed to issue a warn to a player but it warns the admin who executed the command
2)The player's name & the reason is not appering. EXAMPLE : (0) has been warned. Reason: . it should show the player's name and the reason but it doesn't, it just shows the player's ID and instead of showing the reason it just shows a point.
Thanks
I made another command but it's not working correctly (/warn)
How it works?
1)It's supposed to issue a warn to a player but it warns the admin who executed the command
2)The player's name & the reason is not appering. EXAMPLE : (0) has been warned. Reason: . it should show the player's name and the reason but it doesn't, it just shows the player's ID and instead of showing the reason it just shows a point.
pawn Код:
dcmd(warn,4,cmdtext);
pawn Код:
dcmd_warn(playerid,params[])
{
new string[128];
new giveplayerid;
new giveplayer;
new cmdreason[100];
if(PlayerInfo[playerid][pAdmin] < 1)
if(sscanf(params,"us[100]",giveplayerid,cmdreason))
{
SendClientMessage(playerid,COLOR_NUB,"USAGE: /warn <ID> <Reason>");
return 1;
}
if(!IsPlayerConnected(giveplayerid))
{
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);
return 1;
}
format(string,sizeof(string),"{FFFFFF}__**Punished**__{FFFFFF} %s(%d) Has been warned. {FFFFFF}Reason: %s{FFFFFF}",giveplayer,giveplayerid,cmdreason);
SendClientMessageToAll(-1,string);
return 1;
}