Weapon Pickups
#1

Hey i have been thinking of how to create so when you pick up dual guns in a house the automatical gets removed again, i thought of this... But i dont think that is quite the right way..., Could someone please help a little here?



if (GetPlayerWeapon(playerid) == 22)
{
GivePlayerWeapon(playerid,22,0);
Reply
#2

Hey, did you return the value? Try to test it on your server.
If it doesn't work, idk then.
Reply
#3

The problem is i don't know where to put it .... i guess i need something like "AtPlayerPickup" or something, but that dosent exsist xD So i have no clue...
Reply
#4

Use SetPlayerAmmo function.

Quote:
Originally Posted by Rocco
i guess i need something like "AtPlayerPickup" or something, but that dosent exsist xD So i have no clue...
https://sampwiki.blast.hk/wiki/OnPlayerPickUpPickup
Reply
#5

Sweet i will try that

---

Код:
	if (GetPlayerWeapon(playerid) == 22)
	{
	SetPlayerAmmo(playerid,22,0);
	SendClientMessage(playerid,COLOR_RED,"Dual Guns is not allowed");
	return 1;
I placed that under "public OnPlayerPickUpPickup(playerid, pickupid)" - But it dosen't seems to know when the weapon is picked up, since it dosent take it away or write "Dual Guns is not allowed"
Reply
#6

I don't think picking up pickups that are already in the game will call OnPlayerPickUpPickup, you could use a timer for this function instead.
Reply
#7

True, is there a way to toggle off weaponspawns that already is made though?
Reply
#8

Quote:
Originally Posted by Rocco
True, is there a way to toggle off weaponspawns that already is made though?
If you mean removing those pickups for weapons, then no. The only way is to check if they get them and remove them.
Reply
#9

Correct usage:
Quote:
Originally Posted by SA-MP Wiki
SetPlayerAmmo(playerid, weaponslot, ammo);
But i'm not sure if this functions works in SA-MP, many people reported it as bug.

But you could give ammo with GivePlayerWeapon function.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)