SA-MP Forums Archive
[HELP]Door which destroyed only by explosion - 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: [HELP]Door which destroyed only by explosion (/showthread.php?tid=116211)



[HELP]Door which destroyed only by explosion - akis_tze - 27.12.2009

i want to create a door which, if a player want to enter, he must destroy the door with a explosion

if you have any idea how can i do that tell me


Re: [HELP]Door which destroyed only by explosion - cigo - 28.12.2009


put somewhete above main()

Код:
new doors;
put under OnGameModeInit()

Код:
doors = CreateObject( 2587, 0.0, 0.0, 0.0, 0, 0, 96 );
Код:
if(strcmp(cmd, "/ddoors", true) == 0)
	{
  	if(IsPlayerInRangeOfPoint(playerid, 5.0, 0.0,0.0,0.0))
  		{
     	new Float:x, Float:y, Float:z;
  	 		GetPlayerPos(playerid, x, y, z);
    	CreateExplosion(x+random(5), y+random(5), z+random(5), 12, 10.0);
    	DestroyObject(doors);
    }
    else
    {
      SendClientMessage(playerid, COLOR_RED, "You cant opend doors here!");
      return 1;
		}
	}
I have NOT tested it INgame, but in pawn compiler it compiles with no warnings and errors. This is just a small sample. And you have to change the cords with yours, also change object id with yours! Good luck!