Quote:
Originally Posted by peterory
i wan't make a /give command
when player input /give [type] [giveplayerid]
then give that player a gun
and send a message
player give a gun to giveplayer
player give you a gun
can someone tell me ?
i will very thank him
|
pawn Код:
CMD:giveweapon(playerid, params[])
{
new id, weapon, ammo, string[128];
if(sscanf(params, "ud", id, weapon)) return SendClientMessage(playerid, COR_ERRO, "USEAGE: /giveweapon [ID] [WEAPONID]");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COR_ERRO, "Player isn't online.");
if(playerid == id) return SendClientMessage(playerid, COR_ERRO, "You don't give weapon for you.");
GivePlayerWeapon(id, weapon, ammo);
format(string, sizeof(string), "The player %s give you the weapon id %d, %d ammo.", GetName(playerid), arma, municao);
SendClientMessage(id, -1, string);
format(string, sizeof(string), "You give a %s the weapon id %d, %d ammo.", GetName(id), arma, municao);
SendClientMessage(playerid, -1, string);
return 1;
}