09.08.2012, 18:50
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);
}
}