sziasztok próbálkozom létrehozni egy automata kaput de sehogy sem jön össze :S valamiért nem mûködik, a kapu létrejön de nem csinál semmit:S ez lenne a script
#include <a_samp>
#include <streamer>
forward GateCheck(playerid);
new kapu;
public OnFilterScriptInit()
{
kapu=CreateDynamicObject(980, 1497.40002, 993.20001, 12.4, 0, 0, 270);
SetTimer(\"GateCheck\",1000,1);
return 1;
}
public GateCheck(playerid)
{
if(IsPlayerInRangeOfPoint(playerid,10.0,1497.40002, 993.20001, 12.4))
{
MoveObject(kapu, 1497.40002, 993.20001, 6.9, 6.00);
}
else
{
MoveObject(kapu,1497.40002, 993.20001, 12.4, 6.00);
}
}
Mivel a timernek nem adtad meg a playerid értéket. Ezt törld ki: SetTimer(\"GateCheck\",1000,1);
Aztán a script az OnFilterScriptElé ird ezt:
public OnPlayerConnect(playerid)
{
SetTimerEx(\"GateCheck\", 1000, 1, \"i\", playerid);
return 1;
}
#include <a_samp>
new kapu;
public OnFilterScriptInit()
{
kapu = CreateObject(980, .. );
SetTimer(\"kapucheck\", 1000, 1);
}
forward kapucheck();
public kapucheck()
{
new open;
for(new i=GetMaxPlayers(); i > -1; i--)
{
if(IsPlayerConnected( i ) && IsPlayerInRangeOfPoint(i, 5.0, , , ))
{
open = 1;
MoveObject(kapu, , 3.00);
break;
}
}
if(!open)
MoveObject(kapu, , , , 3.00);
}
Tessék.