SA-MP Forums Archive
Roadblock Destroy Help - 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: Roadblock Destroy Help (/showthread.php?tid=123249)



Roadblock Destroy Help - sidhu123 - 24.01.2010

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


Re: Roadblock Destroy Help - [dN]Eagle - 24.01.2010

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.


Re: Roadblock Destroy Help - LuxurioN™ - 24.01.2010

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


Re: Roadblock Destroy Help - sidhu123 - 25.01.2010

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.


Re: Roadblock Destroy Help - Torran - 25.01.2010

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


Re: Roadblock Destroy Help - sidhu123 - 25.01.2010

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


Re: Roadblock Destroy Help - Torran - 25.01.2010

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


Re: Roadblock Destroy Help - sidhu123 - 25.01.2010

And throughout the script, I still use:

RoadBlockMade[playerid] ?


Re: Roadblock Destroy Help - Torran - 25.01.2010

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

RoadBlockMade[playerid] ?
Yes


Re: Roadblock Destroy Help - sidhu123 - 25.01.2010

Kk, trying