25.04.2011, 02:02
Well can i make if player types the weapon id, the other person will also get the gun
pawn Код:
CMD:giveweapon(playerid, params[])
{
if(PlayerData[playerid][AdminLevel] > 3)
{
new id,weap,ammo,str[128],name[MAX_PLAYER_NAME],WeapName[32];
if(sscanf(params,"uii",id,weap,ammo)) return SendClientMessage(playerid,0xFF9900AA,"USAGE: /giveweapon [id] [weapon] [ammo]");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid,0xFF0000FF,"ERROR: That user is not connected!");
GetPlayerName(playerid,name,sizeof(name));
GetWeaponName(weap,WeapName,32);
format(str,sizeof(str),"Administrator %s has gave you an %s (%d) with %d Ammo",name,WeapName,weap,ammo);
SendClientMessage(id,0xFF9900AA,str);
GivePlayerWeapon(id,weap,ammo);
}
else return 0;
return 1;
}