26.10.2011, 19:13
Hi everyone, a few weeks ago i made a topic about how to place simple roadblocks for an rp server, and i got my answer, now theres just 1 thing i need to know, how to delete all created roadblocks? Like for example, if someone is placing a roadblock, and then he leaves the server, then it would be good to have a command that would remove all roadblocks created, could someone help me with this? if you need it, here is the roadblock script
under /deleteblock i would like to place /deleteallblocks, which will delete all the roadblocks created on the server, no matter which player placed it, i would really appreciate some help here, as im new to scripting
Код:
if (strcmp(cmd,"/roadblock",true) == 0) { if(!Blocked[playerid]) { new Float:X,Float:Y,Float:Z,Float:A; GetPlayerPos(playerid, X, Y, Z); GetPlayerFacingAngle(playerid,A); roadblock[playerid] = CreateObject(978, X, Y, Z, 0.0, 0.0, A); Blocked[playerid] = true; return 1; } else return SendClientMessage(playerid, -1, "You already created a roadblock!"); } if (strcmp(cmd,"/deleteblock",true) == 0) { if(Blocked[playerid]) { DestroyObject(roadblock[playerid]); Blocked[playerid] = false; return 1; } else return SendClientMessage(playerid, -1, "You didn't create a roadblock yet!"); }