SA-MP Forums Archive
Tollgates - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Tollgates (/showthread.php?tid=504361)



Tollgates - ExtremeReality - 03.04.2014

Okay so basically ive been trying to add tollgates and when I did we basically have a bug where the tollgates have like double gate object, so if you /opentoll it would open and there'd be another gate below it

When I restarted the server after scripting, it started working for 5 minutes and then someone joined ingame and it stopped working, could there be something wrong?...


Re: Tollgates - benjaminjones - 03.04.2014

Show us your code mate, are we supposed to guess your codes?


Re: Tollgates - Extraordinariness - 04.04.2014

pawn Код:
#define toll "100"
// change your toll price

CMD:opentoll(playerid, params[])
{
    if(IsPlayerInRangeOfPoint(playerid, 100, 2695.6880, -1704.6300, 11.8438))
    {                               // (playerid, Float:range, Float:x, Float:y, Float:z), an example
        if(GetPlayerMoney(playerid) < toll) return SendClientMessage(playerid, 0xFF0000FF, "You do not have enough money to buy a ticket for toll gate!");
        DestroyObject(100); //object ID, that was just an example
        GivePlayerMoney(playerid, - toll);
        SendClientMessage(playerid, 0xFF0000FF, "TOLLGIRL: Thank you for using San Andreas Toll! Have a nice drive!");
    }
    else
    {
        CreateObject(2587, 2001.195679, 1547.113892, 14.283400, 0.0, 0.0, 96.0); //(modelid, Float:X, Float:Y, Float:Z, Float:rX, Float:rY, Float:rZ, Float:DrawDistance), an example
    }
    return 1;
}



Re: Tollgates - Extraordinariness - 04.04.2014

I do not know how MoveObject works so I used DestroyObject.