02.10.2010, 18:57
I was working on a command that gives a player a random gun, everything works, but It doesn't shot the player's name, and the weapon name.
can any one check what's the problem ?
can any one check what's the problem ?
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, wID, 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, wID, Ammo, sendername );
SendClientMessage(otherId, 0xFF4646FF, string);
}
}
return 1;
}