Hold Just One Gun.
#1

How to make that every player can just hold one gun in his hand? Is it that difficult. I am really looking forward to do this i got this idea to prevent some non-rping if you got an idea how to do it i will be very pleased if you can help me

msn: khibs@hotmail.com

Karl1195. Thanks
Reply
#2

You should be able to use this function to do that.
Reply
#3

public OnPlayerSpawn(playerid)
{
SetPlayerSkillLevel(playerid, WEAPONSKILL_SAWNOFF_SHOTGUN, 1);
//This will make them use single-handed sawnoff shotguns.
return 1;
}

Doesn't that just make a player to spawn with a sawnoff shotgun?
Reply
#4

No, it sets the skill level of the sawnoff shotgun to 1. Meaning they can only hold 1 shotgun. Use GivePlayerWeapon to give someone a weapon.
Reply
#5

Ohh cool. So i have to do SetPlayerSkillLevel(playerid, WEAPONSKILL_SAWNOFF_SHOTGUN, 1); For every gun?
Reply
#6

Yes, but replace WEAPONSKILL_SAWNOFF_SHOTGUN for these:
https://sampwiki.blast.hk/wiki/Skillweapons
Reply
#7

In short, you can rewrite a GivePlayerWeaponEx function. Check if the player already has the weapon you want to give him with GetPlayerWeaponData. If he has, give him the weapon normally, else reset his weapons and then give him the weapon.

That wont work for pickups, but you could use custom pickups for that then.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)