Tolls Not Moving -
[LHT]Bally - 09.08.2012
Hi all The problem i have is that when i drive up to the toll it doesnt move it just takes the money i dont understand the problem.
pawn Код:
#include <a_samp>
#include <streamer>
#include <foreach>
#define red 0xFF0000AA
new toll1;
new toll2;
forward Tolls();
forward Timer_TollsClose(tollid);
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print("ToLLz );
print("--------------------------------------\n");
toll1 = CreateObject(968, 1784.3000488281, 903, 9.1000003814697, 0, 90, 2.5);//closed
toll2 = CreateObject(968, 1809.9000244141, 903.29998779297, 9.1000003814697, 0, 268.99987792969, 1.9999389648438);//closed
SetTimer("Tolls", 1500, true);
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
public Tolls()
{
foreach(Player, playerid)
{
if(IsPlayerInRangeOfPoint(playerid, 10.0, 1784.3000488281, 903, 9.1000003814697, 0))
{
MoveObject(toll1, 1784.2998046875, 903, 9.1000003814697, 2.5);
SetPVarInt(playerid, "PVarMoney", -5);
GameTextForPlayer(playerid, "~y~THANK YOU~n~~r~$10", 3000, 3);
SetTimerEx("Timer_TollsClose",5000,false,"i", 0);
}
else
if(IsPlayerInRangeOfPoint(playerid, 10.0, 1809.9000244141, 903.29998779297, 9.1000003814697))
{
MoveObject(toll2, 1809.8000488281, 903.29998779297, 9, 2.5);
SetPVarInt(playerid, "PVarMoney", -5);
GameTextForPlayer(playerid, "~y~THANK YOU~n~~r~$10", 3000, 3);
SetTimerEx("Timer_TollsClose",5000,false,"i", 0);
}
}
}
public Timer_TollsClose(tollid)
{
switch(tollid)
{
case 0: MoveObject(toll1, 1784.3000488281, 903, 9.1000003814697, 0, 2.5);
case 1: MoveObject(toll2, 1809.9000244141, 903.29998779297, 9.1000003814697, 2.5);
}
}
Re: Tolls Not Moving -
DarrenReeder - 09.08.2012
The co-ords your moving the object too are exactly the same?
MoveObject(toll1, 1784.2998046875, 903, 9.1000003814697, 2.5); needs to have different co-ords to the toll1 co-ords...
IF this helped +rep?
Re: Tolls Not Moving -
gnoomen2 - 09.08.2012
Yes that's the problem i noticed that too, Where it says public tolls and you look at the moveobject, make the x, y , z cordinates there, the cordinates where the gate will move to when it is open
Re: Tolls Not Moving -
Djean - 09.08.2012
Hmmmm.......... Are you doing it on a Filter script or in the Game Mode? It affects it.
Re: Tolls Not Moving -
kaisersouse - 09.08.2012
You're not sending which toll ID to move
SetTimerEx("Timer_TollsClose",5000,false,"i", toll1);
SetTimerEx("Timer_TollsClose",5000,false,"i", toll2);
EDIT: well you ARE sending a tollid...but you're sending '0' as the tollid