SA-MP Forums Archive
destroying pickup - 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)
+--- Thread: destroying pickup (/showthread.php?tid=391721)



destroying pickup - Sam5513 - 11.11.2012

Hello.
I have a quick question. I am working with pickups in my script of capture the flag game, where a pickup is a flag. So, If a person from team 1 tries to pickup his own flag, I want the pickup to remove and then spawn another one. Ive visited https://sampwiki.blast.hk/wiki/DestroyPickup this website but they use this to assign id to it:
Код:
pickup_armour = CreatePickup ( 1242, 2, 1503.3359, 1432.3585, 10.1191 );
. When I try doing that, it tells me:
Код:
error 017: undefined symbol "pickup_armour"
What should I do to "define it"? Thank you


Re: destroying pickup - Konstantinos - 11.11.2012

pawn Код:
// At the top, under '#include (s)' and '#define (s)'
new
    pickup_armour
;



Re: destroying pickup - Abhishek. - 11.11.2012

here..
pawn Код:
pickup_armour = CreatePickup ( 1242, 2, 1503.3359, 1432.3585, 10.1191 );
to
new pickup_armour = CreatePickup ( 1242, 2, 1503.3359, 1432.3585, 10.1191 );



Re: destroying pickup - Konstantinos - 11.11.2012

Quote:
Originally Posted by [bot]fatninja
Посмотреть сообщение
here..
pawn Код:
pickup_armour = CreatePickup ( 1242, 2, 1503.3359, 1432.3585, 10.1191 );
to
new pickup_armour = CreatePickup ( 1242, 2, 1503.3359, 1432.3585, 10.1191 );
No, a local variable. It should be a global variable, because if he wants either to destroy or check if he picks up the certain pickup, it will give the same error.


Re: destroying pickup - Abhishek. - 11.11.2012

oh yes the local variable will not be shown out side of the callback :P
use waht Dwane gave you sir
off topic:and why you post in every topic where i do and faster that me like 1 minute faster lol


Re: destroying pickup - Sam5513 - 11.11.2012

Thank you very much guys. You helped a lot