SA-MP Forums Archive
[HELP] TOLL - 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: [HELP] TOLL (/showthread.php?tid=308071)



[HELP] TOLL - quark - 02.01.2012

Hi, i am trying to set "my own" toll system, can somoene help me fix ?

PHP код:
#include <a_samp>
#include <foreach>
#define red 0xFF0000AA
forward Tolls();
forward TollsB();
public 
OnFilterScriptInit()
{
CreateObject(1237,1732.41174316,549.93048096,25.39747238,0.00000000,0.00000000,0.00000000); //object(strtbarrier01) (2)
CreateObject(11547,1753.45874023,545.80615234,27.98274040,0.00000000,3.25100708,71.52276611); //object(desn_tscanopy) (2)
CreateObject(11547,1741.15551758,550.02288818,27.98274040,0.00000000,3.24645996,70.31237793); //object(desn_tscanopy) (3)
CreateObject(1237,1737.39135742,547.93292236,25.39747238,0.00000000,0.00000000,0.00000000); //object(strtbarrier01) (3)
CreateObject(1237,1754.96911621,541.80120850,25.39747238,0.00000000,0.00000000,0.00000000); //object(strtbarrier01) (4)
CreateObject(1237,1760.34997559,540.33251953,25.39747238,0.00000000,0.00000000,0.00000000); //object(strtbarrier01) (5)
CreateObject(1216,1730.25512695,558.55041504,26.36825752,0.00000000,0.00000000,148.68530273); //object(phonebooth1) (1)
CreateObject(1216,1762.97058105,533.00317383,27.45194626,0.00000000,0.00000000,340.49023438); //object(phonebooth1) (2)
CreateObject(3881,1747.52819824,546.90423584,27.08698273,0.00000000,3.25100708,69.89727783); //object(airsecbooth_sfse) (2)
CreateObject(3578,1744.61352539,540.41339111,25.69239426,0.00000000,3.25100708,70.89880371); //object(dockbarr1_la) (1)
CreateObject(3578,1741.41589355,531.01678467,26.25701523,0.00000000,3.24645996,71.52099609); //object(dockbarr1_la) (2)
CreateObject(3578,1738.18322754,521.38134766,26.83430672,0.00000000,3.24645996,71.52099609); //object(dockbarr1_la) (3)
CreateObject(3578,1734.98974609,511.86355591,27.40326881,0.00000000,3.24645996,71.52099609); //object(dockbarr1_la) (5)
CreateObject(3578,1747.27148438,518.12622070,26.26983643,0.00000000,3.20397949,71.51550293); //object(dockbarr1_la) (6)
CreateObject(3578,1741.16772461,558.93695068,24.04631996,0.00000000,3.61853027,71.51000977); //object(dockbarr1_la) (7)
CreateObject(3578,1728.95031738,522.74255371,26.34904480,0.00000000,3.20251465,70.88598633); //object(dockbarr1_la) (8)
CreateObject(1238,1758.63623047,553.33850098,25.13770676,0.00000000,0.00000000,0.00000000); //object(trafficcone) (1)
CreateObject(1238,1747.43017578,518.47277832,27.34927559,0.00000000,0.00000000,0.00000000); //object(trafficcone) (2)
CreateObject(1238,1748.85302734,522.73461914,27.09775543,0.00000000,0.00000000,0.00000000); //object(trafficcone) (3)
CreateObject(1238,1750.25073242,527.04949951,26.81566048,0.00000000,0.00000000,0.00000000); //object(trafficcone) (4)
CreateObject(1238,1751.77099609,532.25512695,26.51770973,0.00000000,0.00000000,0.00000000); //object(trafficcone) (5)
CreateObject(1238,1754.58374023,540.62438965,25.95877838,0.00000000,0.00000000,0.00000000); //object(trafficcone) (6)
CreateObject(3578,1753.29394531,536.78320312,25.11413193,0.00000000,3.61999512,71.51550293); //object(dockbarr1_la) (9)
CreateObject(1238,1753.16894531,536.27343750,26.28799248,0.00000000,0.00000000,0.00000000); //object(trafficcone) (7)
CreateObject(1238,1728.96777344,522.79205322,27.44675827,0.00000000,0.00000000,0.00000000); //object(trafficcone) (8)
CreateObject(1238,1727.37353516,518.16943359,27.71879196,0.00000000,0.00000000,0.00000000); //object(trafficcone) (9)
CreateObject(1238,1730.57910156,527.37335205,27.18301392,0.00000000,0.00000000,336.49511719); //object(trafficcone) (10)
CreateObject(1238,1734.10314941,538.20642090,26.51420212,0.00000000,0.00000000,0.00000000); //object(trafficcone) (11)
CreateObject(1238,1735.57836914,542.43701172,26.23093224,0.00000000,0.00000000,0.00000000); //object(trafficcone) (12)
CreateObject(1238,1737.19982910,547.27673340,25.90814781,0.00000000,0.00000000,0.00000000); //object(trafficcone) (13)
CreateObject(1238,1732.16467285,532.12280273,26.92003250,0.00000000,0.00000000,0.00000000); //object(trafficcone) (14)
CreateObject(1237,1742.56665039,545.96612549,25.55416298,0.00000000,0.00000000,0.00000000); //object(strtbarrier01) (6)
CreateObject(1237,1749.72851562,543.65234375,25.54425240,0.00000000,0.00000000,0.00000000); //object(strtbarrier01) (7)
CreateObject(3337,1748.55712891,544.41284180,23.48670578,0.00000000,0.00000000,249.46557617); //object(cxrf_desertsig) (1)
CreateObject(2921,1760.38159180,539.54693604,30.70943642,0.00000000,19.50613403,95.90545654); //object(kmb_cam) (1)
CreateObject(2921,1731.47912598,549.52703857,30.86637688,0.00000000,19.50390625,120.28735352); //object(kmb_cam) (2)
CreateObject(3578,1735.62890625,542.76953125,25.10892105,0.00000000,3.61450195,71.50451660); //object(dockbarr1_la) (10)
CreateObject(3578,1747.56762695,578.27404785,22.61633682,0.00000000,4.03048706,73.13003540); //object(dockbarr1_la) (11)
CreateObject(3578,1764.88012695,572.78875732,22.62516022,0.00000000,3.82250977,73.13003540); //object(dockbarr1_la) (12)
CreateObject(3578,1758.64147949,553.38458252,24.03923607,0.00000000,3.61450195,73.13003540); //object(dockbarr1_la) (13)
CreateObject(1238,1745.71972656,513.51953125,27.64258957,0.00000000,0.00000000,0.00000000); //object(trafficcone) (15)
CreateObject(1238,1757.23291016,548.70880127,25.44314194,0.00000000,0.00000000,0.00000000); //object(trafficcone) (16)
CreateObject(1238,1761.89135742,563.39648438,24.39044571,0.00000000,0.00000000,0.00000000); //object(trafficcone) (17)
CreateObject(1238,1760.08593750,557.97186279,24.83088684,0.00000000,0.00000000,0.00000000); //object(trafficcone) (18)
CreateObject(1238,1741.17761230,559.35540771,25.24853897,0.00000000,0.00000000,358.33593750); //object(trafficcone) (19)
CreateObject(1238,1766.33117676,577.43151855,23.40133667,0.00000000,0.00000000,0.00000000); //object(trafficcone) (20)
CreateObject(1238,1764.74133301,572.19519043,23.76698112,0.00000000,0.00000000,0.00000000); //object(trafficcone) (21)
CreateObject(1238,1763.54333496,568.17626953,24.04157066,0.00000000,0.00000000,0.00000000); //object(trafficcone) (22)
CreateObject(1238,1739.62597656,554.34710693,25.45351028,0.00000000,0.00000000,0.00000000); //object(trafficcone) (23)
CreateObject(1238,1746.22436523,573.71881104,24.05233383,0.00000000,0.00000000,0.00000000); //object(trafficcone) (27)
CreateObject(1238,1744.50463867,568.20007324,24.43739128,0.00000000,0.00000000,0.00000000); //object(trafficcone) (28)
CreateObject(1238,1742.72351074,563.54974365,24.83945274,0.00000000,0.00000000,0.00000000); //object(trafficcone) (29)
CreateObject(1238,1749.06115723,582.96136475,23.37110901,0.00000000,0.00000000,0.00000000); //object(trafficcone) (30)
CreateObject(1238,1747.63305664,578.12487793,23.72643089,0.00000000,0.00000000,0.00000000); //object(trafficcone) (31)
CreateObject(2921,1734.27832031,556.81933594,30.39555550,0.00000000,19.50073242,258.45043945); //object(kmb_cam) (3)
CreateObject(2921,1762.95288086,547.08728027,30.39555550,0.00000000,19.50073242,295.83435059); //object(kmb_cam) (4)
CreateObject(1237,1751.63623047,549.26818848,25.12846947,0.00000000,0.00000000,0.00000000); //object(strtbarrier01) (8)
CreateObject(1237,1762.11230469,545.95019531,25.17768478,0.00000000,0.00000000,0.00000000); //object(strtbarrier01) (9)
CreateObject(1237,1757.06518555,548.14257812,25.12846947,0.00000000,0.00000000,0.00000000); //object(strtbarrier01) (10)
CreateObject(1237,1749.80664062,549.98999023,25.12846947,0.00000000,0.00000000,0.00000000); //object(strtbarrier01) (11)
CreateObject(1237,1746.63220215,551.21533203,25.12846947,0.00000000,0.00000000,0.00000000); //object(strtbarrier01) (12)
CreateObject(1237,1744.70849609,551.89404297,25.12846947,0.00000000,0.00000000,0.00000000); //object(strtbarrier01) (13)
CreateObject(1237,1739.52978516,553.72216797,25.12846947,0.00000000,0.00000000,0.00000000); //object(strtbarrier01) (14)
CreateObject(1237,1734.35046387,555.54840088,25.12846947,0.00000000,0.00000000,0.00000000); //object(strtbarrier01) (15)
CreateObject(1215,1760.30175781,540.15460205,26.08856964,0.00000000,0.00000000,0.00000000); //object(bollardlight) (1)
CreateObject(1215,1761.48645020,540.28717041,26.07574272,0.00000000,0.00000000,0.00000000); //object(bollardlight) (2)
CreateObject(1215,1766.12719727,544.54510498,25.74362755,0.00000000,0.00000000,0.00000000); //object(bollardlight) (3)
CreateObject(1215,1754.97485352,541.82397461,26.08856964,0.00000000,0.00000000,0.00000000); //object(bollardlight) (4)
CreateObject(1215,1749.70788574,543.50292969,26.08856964,0.00000000,0.00000000,0.00000000); //object(bollardlight) (5)
CreateObject(1215,1742.55993652,546.03283691,26.08856964,0.00000000,0.00000000,0.00000000); //object(bollardlight) (6)
CreateObject(1215,1737.35546875,547.84661865,26.08856964,0.00000000,0.00000000,0.00000000); //object(bollardlight) (7)
CreateObject(1215,1732.43249512,549.79223633,26.08856964,0.00000000,0.00000000,0.00000000); //object(bollardlight) (8)
CreateObject(1215,1734.33972168,555.72161865,25.77468872,0.00000000,0.00000000,0.00000000); //object(bollardlight) (9)
CreateObject(1215,1739.65551758,553.72686768,25.77468872,0.00000000,0.00000000,0.00000000); //object(bollardlight) (10)
CreateObject(1215,1744.72033691,552.02868652,25.77468872,0.00000000,0.00000000,0.00000000); //object(bollardlight) (11)
CreateObject(1215,1746.73095703,551.22644043,25.77468872,0.00000000,0.00000000,0.00000000); //object(bollardlight) (12)
CreateObject(1215,1749.88269043,549.89862061,25.77468872,0.00000000,0.00000000,0.00000000); //object(bollardlight) (13)
CreateObject(1215,1751.64721680,549.41046143,25.77468872,0.00000000,0.00000000,0.00000000); //object(bollardlight) (14)
CreateObject(1215,1757.02099609,548.20428467,25.77468872,0.00000000,0.00000000,0.00000000); //object(bollardlight) (15)
CreateObject(1215,1762.17370605,545.95251465,25.77468872,0.00000000,0.00000000,0.00000000); //object(bollardlight) (16)
CreateObject(1215,1764.25390625,539.36328125,25.93162918,0.00000000,0.00000000,0.00000000); //object(bollardlight) (17)
CreateObject(1215,1762.87402344,546.79632568,30.17237854,0.00000000,0.00000000,0.00000000); //object(bollardlight) (18)
CreateObject(1215,1763.33203125,545.32910156,25.74693108,0.00000000,0.00000000,0.00000000); //object(bollardlight) (19)
CreateObject(1215,1730.90893555,556.88970947,25.70408821,0.00000000,0.00000000,0.00000000); //object(bollardlight) (20)
CreateObject(1215,1731.09545898,550.37872314,25.70408821,0.00000000,0.00000000,0.00000000); //object(bollardlight) (21)
CreateObject(1215,1729.05468750,551.08685303,25.70408821,0.00000000,0.00000000,0.00000000); //object(bollardlight) (22)
CreateObject(1215,1732.96289062,556.11035156,25.70408821,0.00000000,0.00000000,0.00000000); //object(bollardlight) (23)
CreateObject(1215,1760.49011230,539.61486816,30.56472969,0.00000000,0.00000000,0.00000000); //object(bollardlight) (24)
CreateObject(1215,1745.85278320,545.10546875,30.56472969,0.00000000,0.00000000,0.00000000); //object(bollardlight) (25)
CreateObject(1215,1748.06201172,551.15277100,30.25084877,0.00000000,0.00000000,0.00000000); //object(bollardlight) (26)
CreateObject(1215,1734.15405273,556.20825195,30.09390831,0.00000000,0.00000000,0.00000000); //object(bollardlight) (27)
CreateObject(1215,1731.52026367,550.29077148,30.56472969,0.00000000,0.00000000,0.00000000); //object(bollardlight) (28)
SetTimer("Tolls"1500true);
}
public 
OnFilterScriptExit()
{
    return 
1;
}
public 
Tolls()
{
    foreach(
Playerplayerid)
    {
        if(
IsPlayerInRangeOfPoint(playerid15.01753.45874023,545.80615234,27.98274040))
        {
            
GivePlayerMoney(playerid, -10000);
            
GameTextForPlayer(playerid"~y~THANK YOU~n~~r~$10"30003);
        }
    }
}
public 
TollsB()
{
    foreach(
Playerplayerid)
    {
        if(
IsPlayerInRangeOfPoint(playerid15.01732.6490,553.5985,26.2976,249.7616))
        {
            
GivePlayerMoney(playerid, -10000);
            
GameTextForPlayer(playerid"~y~THANK YOU~n~~r~$10"30003);
        }
    }




Re: [HELP] TOLL - Dark_Kostas - 02.01.2012

Your code should work, but there will be some problems. For example if you go at that point and don't leave immediately you will lose cash all the time(each 1.5 sec based on your timer). So what i would do is to use ShowPlayerDialog if he is close and let him choose if he wants to go through the toll.

Answer yes? Lose money and MoveObject(and then a timer to move them back to original position)
Answer no? Do nothing.


Re: [HELP] TOLL - quark - 02.01.2012

How can i create bool? Then when Player pass there, for 10 seconds , he can pass again without pay =)

And the code give this:
PHP код:
C:\Users\\Desktop\tolls.pwn(127) : warning 202number of arguments does not match definition 



Re: [HELP] TOLL - Dark_Kostas - 02.01.2012

https://sampforum.blast.hk/showthread.php?tid=92 Make sure you read wiki, it contains a lot of information.


Re: [HELP] TOLL - quark - 02.01.2012

Thank you.