14.11.2010, 19:42
iv made a basic tollboth on the bridge to lv from ls but they can do /paytoll anywhere thoughout sa, and i get one error tht the script hasnt closed. can anyone help me?
PHP код:
#include <a_samp>
#define COLOR_RED 0xAA3333AA
#define COLOR_DBLUE 0x2641FEAA
new gate2;
new gate3;
new gate4;
new gate5;
forward GateClose1(playerid);
forward GateClose2(playerid);
forward PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z);
public OnFilterScriptInit()
{
gate2 = CreateObject(968, 1745.9000244141, 524.20001220703, 27.689956665039, 0, 90, 340);
gate4 = CreateObject(968, 1745.9362792969, 524.18157958984, 27.725173950195, 0, 90, 339.99938964844);
CreateObject(991, 1737.5550537109, 527.28869628906, 27.918104171753, 0, 0, 340);
CreateObject(991, 1742.7351074219, 525.42553710938, 27.937757492065, 0, 0, 339.99938964844);
CreateObject(991, 1755.7312011719, 520.65948486328, 27.955936431885, 0, 0, 339.99938964844);
CreateObject(991, 1724.5802001953, 531.8828125, 27.92366027832, 0, 0, 339.99938964844);
CreateObject(966, 1734.2086181641, 528.40533447266, 26.715398788452, 0, 0, 340);
CreateObject(966, 1746.1066894531, 524.16827392578, 26.725173950195, 0, 0, 160);
CreateObject(4642, 1753.1783447266, 519.68542480469, 28.541940689087, 0, 0, 250);
CreateObject(4642, 1735.9213867188, 529.79211425781, 28.306367874146, 0, 0, 249.99938964844);
return 1;
}
public GateClose1()
{
DestroyObject( gate3 );
gate2 = CreateObject(968, 1734.2583007813, 528.259765625, 27.669494628906, 0, 90, 160);
return 1;
}
public GateClose2()
{
DestroyObject( gate4 );
gate5 = CreateObject(968,1746.1977539063,524.39599609375,27.64457321167,0,0,339.99938964844);
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/paytoll", true))
{
DestroyObject( gate2 );
gate3 = CreateObject(968, 1734.2001953125, 528.40203857422, 27.715398788452, 0, 0, 159.99938964844);
SetTimer("GateClose1", 6000, 0);
SendClientMessage(playerid, COLOR_DBLUE,"The gate is opened and will close in 6 seconds.");
return 1;
}
if(!strcmp(cmdtext, "/paytoll", true))
{
DestroyObject( gate5 );
gate4 = CreateObject(968, 1745.9362792969, 524.18157958984, 27.725173950195, 0, 90, 339.99938964844);
SetTimer("GateClose2", 6000, 0);
SendClientMessage(playerid, COLOR_DBLUE,"The gate is opened and will close in 6 seconds.");
return 1;
}