02.10.2010, 19:09
I think it should be:
I'm not sure about it.
pawn Код:
CMD:gw(playerid, params[])
{
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xFF4646FF, "You are not authorized to use that command !");
else
{
new pID, wID, Ammo;
new otherId;
new sendername[MAX_PLAYER_NAME];
new gunname[32];
new string[256];
if(!IsPlayerConnected(pID)) return SendClientMessage(playerid, COLOR_RED, "* User is offline!");
{
if(sscanf(params, "rii", otherId, wID, Ammo)) return SendClientMessage(playerid, 0xAFAFAFAA, "Usage: /gw [PlayerID/PartOfName] [Weapon ID] [Ammo/Quantity]");
GetWeaponName(pID,gunname,sizeof(gunname));
format(string, sizeof(string), "* You have successfully given %s Weapon ID: %s Ammo/Quantity: %d.",sendername, gunname, Ammo);
SendClientMessage(playerid, COLOR_LIGHTRED, string);
GivePlayerWeapon(otherId, weaponID, Ammo);
GetWeaponName(pID,gunname,sizeof(gunname));
GetPlayerName(playerid, sendername, sizeof(sendername)); // This is for admin name
format(string, sizeof(string), "* You have been given a %s ID:%d Ammo/Quantity: %d by Admin %s ",gunname, weaponID, Ammo, sendername );
SendClientMessage(otherId, 0xFF4646FF, string);
}
}
return 1;
}