Okay i got 2 problems.
Problem 1: When i use /usetolls the tolls spawn but when i do /dontusetolls they don't despawn
Problem 2: /payntoll doesn't make the toll gate to go up.
pawn Код:
CMD:dontusetolls(playerid, params[])
{
if(PlayerInfo[playerid][pAdminDuty] == 0) return SendClientMessage(playerid, -1, "You must be ( /aduty ) to use this Command!");
if(PlayerInfo[playerid][pAdmin] < 99999) return SendClientMessage(playerid, COLOR_GREY, "You are not an authorized to use this command.");
SendClientMessage(playerid,COLOR_BLUE,"All Tolls Gate destroyed");
DestroyObject(tollgate1); // Santa Maria Beach Toll
DestroyObject(tollgate2); // Santa Maria Beach Toll
DestroyObject(tollgate3); // Toll Bridge LEFT
DestroyObject(tollgate4); // Toll Bridge MIDDLE
return 1;
}
CMD:usetolls(playerid, params[])
{
if(PlayerInfo[playerid][pAdminDuty] == 0) return SendClientMessage(playerid, -1, "You must be ( /aduty ) to use this Command!");
if(PlayerInfo[playerid]
[pAdmin] < 99999) return SendClientMessage(playerid, COLOR_GREY, "You are not an authorized to use this command.");
SendClientMessage(playerid,COLOR_BLUE,"Tolls Gate Added");
tollgate1 = CreateDynamicObject(968,38.00000000,-1525.19995117,4.90000010,359.99560547,89.49993896,88.00000000); // Santa Maria Beach Toll
tollgate2 = CreateDynamicObject(968,65.19999695,-1537.90002441,4.69999981,0.00000000,270.25024414,85.99548340); // Santa Maria Beach Toll
tollgate3 = CreateDynamicObject(968,-197.50000000,254.19999695,11.80000019,0.06979370,88.00122070,343.75128174); // Toll Bridge LEFT
tollgate4 = CreateDynamicObject(968,608.79998779,347.20001221,18.50000000,0.00000000,87.74996948,36.00000000); // Toll Bridge MIDDLE
return 1;
}
CMD:payntoll(playerid, params[])
{
if(tollstatus==0)
{
SendClientMessage(playerid,COLOR_GRAD1,"Usage of Toll's has been DEAUTHORIZED by the LSPD");
return 1;
}
if(GetPlayerMoney(playerid) < 45)
{
SendClientMessage(playerid,COLOR_GRAD1," You don't have enough cash to pay for the Toll Fee");
return 1;
}
if(IsPlayerInRangeOfPoint(playerid, 12.0, 37.74, -1520.81, 5.22)) // Santa Maria Beach 2
{
if(tollopen==0)
{
SetObjectRot(tollgate1, 359.99560547,89.49993896-90,88.00000000); // Gate 1
GivePlayerMoney(playerid, -100);
SetTimerEx("santamariabeachtoll", 7000, false, "i", playerid);
SendClientMessage(playerid,COLOR_GRAD1," Toll Guard: Thank you for paying 100$, drive safe!");
SendClientMessage(playerid,COLOR_GRAD1," (( The toll gate will close in 8 seconds, don't get trapped down! ))");
tollopen = 1;
}
else
{
SendClientMessage(playerid,COLOR_GRAD1," Toll Guard: A Toll is currently open, please wait");
}
}
else if(IsPlayerInRangeOfPoint(playerid, 12.0, 65.34, -1541.46, 5.05)) // Santa Maria Beach 1
{
if(tollopen==0)
{
SetObjectRot(tollgate2, 0.00000000,270.25024414+90,85.99548340); // Gate 2
GivePlayerMoney(playerid, -100);
SetTimerEx("santamariabeachtoll", 7000, false, "i", playerid);
SendClientMessage(playerid,COLOR_GRAD1," Toll Guard: Thank you for paying 100$, drive safe!");
SendClientMessage(playerid,COLOR_GRAD1," (( The toll gate will close in 8 seconds, don't get trapped down! ))");
tollopen = 1;
}
else
{
SendClientMessage(playerid,COLOR_GRAD1," Toll Guard: A Toll is currently open, please wait");
}
}
else if(IsPlayerInRangeOfPoint(playerid, 15.0, -194.01, 253.57, 12.08)) // Left Bridge
{
if(tollopen==0)
{
SetObjectRot(tollgate3, 0.06979370,88.00122070-90,343.75128174);
GivePlayerMoney(playerid, -100);
SetTimerEx("bridge1toll", 7000, false, "i", playerid);
SendClientMessage(playerid,COLOR_GRAD1," Toll Guard: Thank you for paying 100$, drive safe!");
SendClientMessage(playerid,COLOR_GRAD1," (( The toll gate will close in 8 seconds, don't get trapped down! ))");
tollopen = 1;
}
else
{
SendClientMessage(playerid,COLOR_GRAD1," Toll Guard: A Toll is currently open, please wait");
}
}
else if(IsPlayerInRangeOfPoint(playerid, 15.0, 610.81, 349.13, 18.93)) // Middle Bridge
{
if(tollopen==0)
{
SetObjectRot(tollgate4, 0.00000000,87.74996948-90,36.00000000);
GivePlayerMoney(playerid, -100);
SetTimerEx("bridge2toll", 7000, false, "i", playerid);
SendClientMessage(playerid,COLOR_GRAD1," Toll Guard: Thank you for paying 100$, drive safe!");
SendClientMessage(playerid,COLOR_GRAD1," (( The toll gate will close in 8 seconds, don't get trapped down! ))");
tollopen = 1;
}
else
{
SendClientMessage(playerid,COLOR_GRAD1," Toll Guard: A Toll is currently open, please wait");
}
}
else
{
SendClientMessage(playerid,COLOR_GRAD1," You are not in-range of any toll");
return 1;
}
return 1;
}