Giving guns
#1

Hello, I kinda have problem with this. I want to make command /givegun ID that gives a gun to the player from player. So Lets say I'm holding Colt and script checks my hand and it gives the guy I put the ID in that colt and removes from my hand.
Reply
#2

for this type of script you need to use GetPlayerWeaponData
It will return everything that you are holding. Study it a little, and see what you can come up with.

https://sampwiki.blast.hk/wiki/GetPlayerWeaponData
Reply
#3

pawn Код:
CMD:givegun(playerid,params[])
{
   new id;
   If(sscanf(params,"u",id)) return SendClientMessage(playerid,-1,"USAGE: /givegun [id]");
   GivePlayerWeapon(id,GetPlayerWeapon(playerid),GetPlayerAmmo(playerid));
    SetPlayerAmmo(playerid,GetPlayerWeapon(playerid),0);
return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)