Weapon Pickups - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Weapon Pickups (
/showthread.php?tid=89705)
Weapon Pickups -
Rocco - 03.08.2009
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);
Re: Weapon Pickups -
speedruntrainer - 03.08.2009
Hey, did you return the value? Try to test it on your server.
If it doesn't work, idk then.
Re: Weapon Pickups -
Rocco - 04.08.2009
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...
Re: Weapon Pickups -
Correlli - 04.08.2009
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
Re: Weapon Pickups -
Rocco - 04.08.2009
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"
Re: Weapon Pickups -
JaTochNietDan - 04.08.2009
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.
Re: Weapon Pickups -
Rocco - 04.08.2009
True, is there a way to toggle off weaponspawns that already is made though?
Re: Weapon Pickups -
JaTochNietDan - 04.08.2009
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.
Re: Weapon Pickups -
Correlli - 04.08.2009
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.