PDA

View Full Version : Tolls Not Moving


[LHT]Bally
09/08/2012, 06:50 PM
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.

#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);



}
}

DarrenReeder
09/08/2012, 07:27 PM
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?

gnoomen2
09/08/2012, 07:40 PM
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

Djean
09/08/2012, 08:29 PM
Hmmmm.......... Are you doing it on a Filter script or in the Game Mode? It affects it.

kaisersouse
09/08/2012, 08:35 PM
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