Roadblock - 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 (
/showthread.php?tid=160597)
Roadblock -
GangsTa_ - 17.07.2010
How to make a roadblock system?
Like when you write /roadblock it creates behind you
When you write /droadblock to delete it.
I want just a roadblock object..
Roadblock ID is 973 I think..
Can you help?
Re: Roadblock -
Grim_ - 17.07.2010
There are some on these forums, so search.
And you can use check the players position behind the player (GetXYBehindPlayer (custom function, search for it)) and create the objects there.
Re: Roadblock -
GangsTa_ - 17.07.2010
I found one , but got errors in the script.
Re: Roadblock -
bartje01 - 17.07.2010
pawn Code:
if(strcmp(cmd, "/backup", true)==0)
{
if(TEAM_SAPD[playerid] >=1)
{
for(new i; i<MAX_PLAYERS; i++)
{
new Float:X,Float:Y,Float:Z;
GetPlayerPos(i,X,Y,Z);
CreateObject(i, 973, X, Y, Z, 30, 0 );
}
}
else
{
SendClientMessage(playerid,COLOR_RED,"You are not part of the sapd");
}
return 1;
}
I think this will help
Re: Roadblock -
GangsTa_ - 17.07.2010
Didn't got Teams defined yet because they are just bugged now..
Re: Roadblock -
bartje01 - 17.07.2010
if(strcmp(cmd, "/roadblock", true)==0)
{
for(new i; i<MAX_PLAYERS; i++)
{
new Float:X,Float:Y,Float:Z;
GetPlayerPos(i,X,Y,Z);
CreateObject(i, 973, X, Y, Z, 30, 0 );
}
return 1;
}
Re: Roadblock -
Vince - 17.07.2010
Fail coding.
Will crash the server for sure, because you're creating 500 objects (the size of MAX_PLAYERS) that don't exist.
Re: Roadblock -
GangsTa_ - 17.07.2010
Help pls. No team needed, I'll just make a private cmd.
Re: Roadblock -
bartje01 - 17.07.2010
Well, Vince ssaid I made a fail coding. So now I hope he will make it perfect

Show your skills vince
Re: Roadblock -
Typhome - 17.07.2010
Code:
if(strcmp(cmd, "/roadblock", true)==0)
{
new Float:X,Float:Y,Float:Z;
GetPlayerPos(playerid,X,Y,Z);
CreateObject(playerid, 973, X, Y, Z, 30, 0 );
return 1;
}