06.10.2011, 16:54
I'm new to scripting and started to make some basic commands, 1 thing i have a problem with is how to set a limit? for example with this:
My problem here is that i can create unlimited roadblocks, but only delete 1 (like, i place 2 roadblocks, but i can only do /deleteblock once where it works) i thought that a limit could solve this, but i have no clue how to set a limit for placing objects, i searched around for long and didn't find anything, if anyone could help me i would be thankfull.
Another thing, if you know how to make it so i can use /deleteblock more than once that would be very great aswell, either where it just delete 1 roadblock at a time, or perhaps a /deleteallblocks which would delete all roadblocks.
Код:
if (strcmp(cmd,"/roadblock",true) == 0) { new Float:X,Float:Y,Float:Z,Float:A; GetPlayerPos(playerid, X, Y, Z); GetPlayerFacingAngle(playerid,A); roadblock = CreateObject(978, X, Y, Z, 0.0, 0.0, A); return 1; } if (strcmp(cmd,"/deleteblock",true) == 0) { DestroyObject(roadblock); return 1; }
Another thing, if you know how to make it so i can use /deleteblock more than once that would be very great aswell, either where it just delete 1 roadblock at a time, or perhaps a /deleteallblocks which would delete all roadblocks.