SA-MP Forums Archive
Gate problem - 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: Gate problem (/showthread.php?tid=130096)



Gate problem - RoneyRemington - 25.02.2010

I have a gate that i made to test the open/close function. But the commands dont make it move. Help please if you can.

top of script
Код:
new brandongate1;
public OnGameModeInit()
Код:
brandongate1 = CreateObject(969, 1530.947265625, 96.14453125, 28.636119842529, 0, 0, 25.801391601563);
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
	if(!strcmp(cmdtext,"/opengate",true))//Will open your gates
	{
  MoveObject(brandongate1, 1538.9044189453, 100.001953125, 28.584012985229, 2.5);
  return 1;
	}
	if(!strcmp(cmdtext,"/closegate",true))//Will close your gates
	{
  MoveObject(brandongate1, 1530.947265625, 96.14453125, 28.636119842529, 2.5);
  return 1;
	}
  return 0;
}



Re: Gate problem - aircombat - 25.02.2010

the code is fine idk why it doesnt move but u can try agate generator it might help u (my attachements)
V
V
V
V
V
V
________
Starcraft Replays Terran


Re: Gate problem - RoneyRemington - 25.02.2010

hmmm that didnt work either. should i try in a filterscritp?


Re: Gate problem - RoneyRemington - 25.02.2010

Код:
[#include <a_samp>

new Brandongate1;

public OnFilterScriptInit()
{
Brandongate1 = CreateObject(969, 1530.947265625, 96.14453125, 28.636119842529, 0, 0, 25.801391601563);
return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/opengate", cmdtext, true, 10) == 0)
{
if(IsPlayerInRangeOfPoint(playerid, 5, 1530.947265625, 96.14453125, 28.636119842529))
{
MoveObject(Brandongate1, 1538.9044189453, 100.001953125, 28.584012985229, 2);
SendClientMessage(playerid, 0xFFFFFF, "You've opened Brandon's House gate");
}
return 1;
}
if (strcmp("/closegate", cmdtext, true, 10) == 0)
{
if(IsPlayerInRangeOfPoint(playerid, 5, 1530.947265625, 96.14453125, 28.636119842529))
{
MoveObject(Brandongate1, 1530.947265625, 96.14453125, 28.636119842529, 2);
SendClientMessage(playerid, 0xFFFFFF, "You've closed Brandon's House gate");
}
return 1;
}
return 0;
}

/code]

that is the whole filterscript made by agate generator