Roadblock Destroy Help
#1

Hello! I'm scripting a road block command for my server. I've gotten off to a pretty good start so far. I am able to make roadblocks, but I am having trouble with destroying the roadblocks.

If I type /rb, a roadblock is created. I can create more than 1 roadblock with the command. When I type /drb to destroy the roadblock, only the last made roadblock gets deleted. I am not able to delete the previously made roadblocks.

Can someone please help me fix this?

Thanks!

http://pastebin.com/m4a46389
Reply
#2

All I can say is use ID's.

Example :
/rb 1
/rb 2
/rb 3

And then use /drb 1.

Because pawn doesn't knows what roadblock to destroy and because of that it will pick the last one.


Correct me if I am wrong.
Reply
#3

You have to create a file, so that all objects created are saved there. So then you can delete in order!
Reply
#4

Better yet, how can I script this?

Every player can only make 1 roadblock at a time. Before they make a new one, they must have destroyed the previous one.
Reply
#5

Quote:
Originally Posted by [SAP
Sidhu ]
Better yet, how can I script this?

Every player can only make 1 roadblock at a time. Before they make a new one, they must have destroyed the previous one.
Id do it this way:

Roadblock[playerid] = 1;

When a person uses the command it sets tht above /\ and creates a roadblock,
If they say the command again it checks to see if(Roadblock[playerid] == 0)
if it is, it lets em create a roadblock, but,
else if(Roadblock[playerid] == 1) it sends a message,

Atleast thats how id do it
Reply
#6

I did that. At the top, I put:

Код:
new RoadBlockMade[playerid];
and I get 2 errors. They are:

C:\Users\Noorie\Desktop\Transporter.pwn(110) : error 017: undefined symbol "playerid"
C:\Users\Noorie\Desktop\Transporter.pwn(110) : error 009: invalid array size (negative, zero or out of bounds)
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase

2 Errors.

*Note: the line above the errors is line 110
Reply
#7

Quote:
Originally Posted by [SAP
Sidhu ]
I did that. At the top, I put:

Код:
new RoadBlockMade[playerid];
and I get 2 errors. They are:

C:\Users\Noorie\Desktop\Transporter.pwn(110) : error 017: undefined symbol "playerid"
C:\Users\Noorie\Desktop\Transporter.pwn(110) : error 009: invalid array size (negative, zero or out of bounds)
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase

2 Errors.

*Note: the line above the errors is line 110
new RoadBlockMade[MAX_PLAYERS];

Try that
Reply
#8

And throughout the script, I still use:

RoadBlockMade[playerid] ?
Reply
#9

Quote:
Originally Posted by [SAP
Sidhu ]
And throughout the script, I still use:

RoadBlockMade[playerid] ?
Yes
Reply
#10

Kk, trying
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)