destroying pickup
#1

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
Reply
#2

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

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 );
Reply
#4

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.
Reply
#5

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
Reply
#6

Thank you very much guys. You helped a lot
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)