28.08.2011, 08:18
im now using it like this . is this how you ment it to be?
pawn Code:
#include <a_samp>
#include <streamer>
#include <foreach>
new toll1;
forward Tolls();// The FUNCTION To Make The Tolls Work
forward Timer_TollsClose(tollid); // The Timer Making The Tolls Close
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print("Toll script by Bally for Long Haul Trucking");
print("--------------------------------------\n");
toll1 = CreateDynamicObject(3578, 1651.2354736328, -43.643432617188, 36.139217376709, 0, 0, 21.5);
SetTimer("Tolls", 1500, true);
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
public Tolls()
{
foreach(Player, playerid)
{
if(IsPlayerInRangeOfPoint(playerid, 5, 1651.2354736328, -43.643432617188, 36.139217376709)) // Checking If The Player Is In Range Of Any Of The Tolls
{
MoveDynamicObject(toll1, 1651.2353515625, -43.642578125, 34.464115142822, 2.5); // Moves Toll1
GivePlayerMoney(playerid, -10); // Takes 10 Off Players Money LEAVE THIS AS IT IS
GameTextForPlayer(playerid, "~r~THANK YOU~n~~b~$10", 30000, 3);
SetTimerEx("Timer_TollsClose",5000,true,"i",0);
}
}
}
public Timer_TollsClose(tollid)
{
switch(tollid)
{
case 0: MoveDynamicObject(toll1, 1651.2354736328, -43.643432617188, 36.139217376709, 2.5); // Moves The Toll Back Cords found On the original CreateDynamicObject function
}
}