[SOLVED]Roadblock Destroy all quistion - 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: [SOLVED]Roadblock Destroy all quistion (
/showthread.php?tid=78892)
[SOLVED]Roadblock Destroy all quistion -
killer94nl - 23.05.2009
hey People
I got a question , i created/edited a roadblock script , but when i make more then 1 roadblock and i remove one it only removes the last one i made , so could someone please help me to create a command that deletes all the roadblocks ?
That would be awesome
Thnx
[NL]Killer94
Код:
if(strcmp(cmd, "/roadblock", true) == 0)
{
if(roadblock[playerid] == 0)
if (gTeam[playerid] == 2)
{
new Float:x, Float:y, Float:z, Float:a;
GetPlayerFacingAngle(playerid,a);
GetPlayerPos(playerid, x, y, z);
block = CreateStreamObject(981,x,y,z,0.0,0.0,a,200.00);
SendClientMessage(playerid,COLOR_GREY, "You made a roadblock");
roadblock[giveplayerid] = 1;
new Float:slx, Float:sly, Float:slz;
GetPlayerPos(playerid, slx, sly, slz);
SetPlayerPos(playerid, slx, sly, slz+4);
}
else
{
SendClientMessage(playerid, COLOR_RED, "you have all ready made a roadblock (/removeroadblock)");
}
}
else if(strcmp(cmd,"/removeroadblock", true)== 0)
if (gTeam[playerid] == 2)
{
DestroyStreamObject(block);
SendClientMessage(playerid,COLOR_GREY, "You removed your roadblock, you can new make a new one");
roadblock[giveplayerid] = 0;
return 1;
}
Re: Roadblock Destroy all quistion -
jonesy - 23.05.2009
pawn Код:
//change new block; to:
new block[MAX_PLAYERS];
//change commands to:
if(strcmp(cmd, "/roadblock", true) == 0)
{
if(roadblock[playerid] == 0)
if (gTeam[playerid] == 2)
{
new Float:x, Float:y, Float:z, Float:a;
GetPlayerFacingAngle(playerid,a);
GetPlayerPos(playerid, x, y, z);
block[playerid] = CreateStreamObject(981,x,y,z,0.0,0.0,a,200.00);
SendClientMessage(playerid,COLOR_GREY, "You made a roadblock");
roadblock[giveplayerid] = 1;
new Float:slx, Float:sly, Float:slz;
GetPlayerPos(playerid, slx, sly, slz);
SetPlayerPos(playerid, slx, sly, slz+4);
}
else
{
SendClientMessage(playerid, COLOR_RED, "you have all ready made a roadblock (/removeroadblock)");
}
}
else if(strcmp(cmd,"/removeroadblock", true)== 0)
if (gTeam[playerid] == 2)
{
DestroyStreamObject(block[playerid]);
SendClientMessage(playerid,COLOR_GREY, "You removed your roadblock, you can new make a new one");
roadblock[giveplayerid] = 0;
return 1;
}
Re: Roadblock Destroy all quistion -
killer94nl - 24.05.2009
Quote:
Originally Posted by jonesy
pawn Код:
//change new block; to: new block[MAX_PLAYERS];
//change commands to: if(strcmp(cmd, "/roadblock", true) == 0) { if(roadblock[playerid] == 0) if (gTeam[playerid] == 2) { new Float:x, Float:y, Float:z, Float:a; GetPlayerFacingAngle(playerid,a); GetPlayerPos(playerid, x, y, z); block[playerid] = CreateStreamObject(981,x,y,z,0.0,0.0,a,200.00); SendClientMessage(playerid,COLOR_GREY, "You made a roadblock"); roadblock[giveplayerid] = 1; new Float:slx, Float:sly, Float:slz; GetPlayerPos(playerid, slx, sly, slz); SetPlayerPos(playerid, slx, sly, slz+4); } else { SendClientMessage(playerid, COLOR_RED, "you have all ready made a roadblock (/removeroadblock)"); } } else if(strcmp(cmd,"/removeroadblock", true)== 0) if (gTeam[playerid] == 2) { DestroyStreamObject(block[playerid]); SendClientMessage(playerid,COLOR_GREY, "You removed your roadblock, you can new make a new one"); roadblock[giveplayerid] = 0; return 1; }
|
Thnx man

, Your awesome xD