Skripta koju koristim:od 0
Detaljan opis problema:Pravim skriptu automatska vrata da se otvaraju i zatvaraju kad igrac pridje blizu vratima,ali imam jedan erorr
Dio skripte:]
#include <a_samp>
new gate;
new bool:gateopen;
public OnFilterScriptInit()
{
SetTimer("GateCheck", 800, true);
gate = CreateObject(968,1544.6999500,-2279.3999000,13.0000000,0.0000000,0.0000000,0.0000000);
return 1;
}
forward GateCheck();
public GateCheck()
{
for(new i; i < MAX_PLAYERS; i++)
{
if(IsPlayerInRangeOfPoint(playerid, 1549.8815,-2274.1770,13.5495,185.4498))
{
if(gateopen == false)
{
MoveObject(gate, 1544.6999500,-2279.3999000,13.0000000, 3.5);
gateopen = true;
}
return;
}
}
if(gateopen == true)
{
MoveObject(gate, 1544.6999500,-2279.3999000,13.0000000, 3.5);
gateopen = false;
}
}
http://picturepush.com/public/12551651 (http://picturepush.com/public/12551651)
Ako koristiš foreach moraš koristiti "i".
mozes malo pojasniti? srry tek sam poceo sriptat
#include <a_samp>
new gate;
new bool:gateopen;
public OnFilterScriptInit()
{
SetTimer("GateCheck", 800, true);
gate = CreateObject(968,1544.6999500,-2279.3999000,13.0000000,0.0000000,0.0000000,0.0000000);
return 1;
}
forward GateCheck();
public GateCheck()
{
for(new i; i < MAX_PLAYERS; i++)
{
if(IsPlayerInRangeOfPoint(i, 1549.8815,-2274.1770,13.5495,185.4498))
{
if(gateopen == false)
{
MoveObject(gate, 1544.6999500,-2279.3999000,13.0000000, 3.5);
gateopen = true;
}
else if(gateopen == true)
{
MoveObject(gate, 1544.6999500,-2279.3999000,13.0000000, 3.5);
gateopen = false;
}
return 1;
}
}
}
probaj ovako ;)