Toll system, needed
#1

Hey guys,

I had a toll system in my script (from ppc) but it was not working how I want it and the toll was not opening etc..

I want a new fresh toll system, and my question is: Who can make one for me? (maybe for a little money)

What I want:

- When you drive into a toll, automatically opens the toll, and $30 dollars are getting of the player (message to player: You paid $30 toll, have a nice day!).

- Also the toll is checking the players wanted lvl, when it is higher than 3 stars, there will be a message: You cant enter the toll, your wanted level is too high, look for another route! (just in the chat(red))

- It have to be easy to edit (so I can add more toll in the future by myself).

The best would be a filterscript, but if not possible I cant put it in the main script (or maybe an include?)

Leave your reply if you can help me with this!

Thanks

Jer

BTW: you dont have to map things, I can do that by myself!
Reply
#2

Why dont you learn how to make it yourself? It's basically a gate, just that when you want to open it, it checks your wanted level and takes money.
Reply
#3

Quote:
Originally Posted by Dan.
Посмотреть сообщение
Why dont you learn how to make it yourself? It's basically a gate, just that when you want to open it, it checks your wanted level and takes money.
Well I can make gates by myself, but i don't know how to open it automatic, and how to take money and how to check the lvl and how to let lvl 1/2/3 continue and >4 not.
Reply
#4

There are a lot of tutorials on automatic gates.

Checking wanted level:
https://sampwiki.blast.hk/wiki/GetPlayerWantedLevel

Checking money:
https://sampwiki.blast.hk/wiki/GetPlayerMoney

You just do:

pawn Код:
if(GetPlayerWantedLevel(playerid) > 3) // Checks if wanted level is over 3..
{
    SendClientMessage(playerid, RED, "Your wanted level is over 3, gate wont open!");
}
else // If the wanted level isn't over 3..
{
    // Open the gate
}
And same with the cash, you should at least try and then get help about the problems.
Reply
#5

You can learn from existing scripts

http://forum.sa-mp.com/search.php?searchid=4823159
Reply
#6

use IsPlayerInRangeOfPoint, then check if the player is wanted, if not deduct the cash and let him go.
Reply
#7

Thanks thanks, I will give it a try!
Reply
#8

hmm now im stuck...
Got this errors:

C:\Users\Jeremy\Desktop\World European Trucking Server\filterscripts\tolls-jer.pwn(41) : warning 215: expression has no effect
C:\Users\Jeremy\Desktop\World European Trucking Server\filterscripts\tolls-jer.pwn(41) : error 001: expected token: ";", but found ")"
C:\Users\Jeremy\Desktop\World European Trucking Server\filterscripts\tolls-jer.pwn(41) : error 029: invalid expression, assumed zero
C:\Users\Jeremy\Desktop\World European Trucking Server\filterscripts\tolls-jer.pwn(45) : error 029: invalid expression, assumed zero
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


3 Errors.

On this script:
PHP код:
#include <a_samp>
#include <streamer>
#include <foreach>
#define red 0xFF0000AA
new toll1;
forward Tolls();
forward Timer_TollsClose(tollid);
public 
OnFilterScriptInit()
{
    print(
"\n--------------------------------------");
    print(
"ToLLz By jeremy8810");
    print(
"--------------------------------------\n");
    
toll1 CreateDynamicObject(35781651.2354736328, -43.64343261718836.1392173767090021.5);         //toll-barrier start position (toll is closed)
    
CreateDynamicObject(38811657.2738037109, -38.7260742187537.2669296264650020.5);                //lv toll object
    
CreateDynamicObject(38811645.2979736328, -48.71124649047937.26692962646500201.24499511719);     //lv toll object
    
CreateDynamicObject(9781644.5096435547, -58.16750717163135.97201538085900272);                 //lv toll object
    
CreateDynamicObject(9791663.5103759766, -44.45117187535.93604278564500129.75);                 //lv toll object
    
CreateDynamicObject(9781656.4311523438, -30.88540267944335.9392280578610074);                 //lv toll object
    
CreateDynamicObject(9791638.6834716797, -43.44638824462935.92470550537100315);                //lv toll object
    
SetTimer("Tolls"1500true);
    return 
1;
}
public 
OnFilterScriptExit()
{
    return 
1;
}
public 
Tolls()
{
    foreach(
Playerplayerid)
    {
        if (
IsPlayerInRangeOfPoint(playerid15.01651.2354736328, -43.64343261718836.139217376709))
        
GetPlayerWantedLevel(playerid) > 3// Checks if wanted level is over 3..
        
{
        
SendClientMessage(playeridred"Your wanted level is 3 or higher, take another way!");
        }
        else
        {
            
MoveDynamicObject(toll11651.2353515625, -43.64257812534.4641151428222.5);
            
GivePlayerMoney(playerid, -30);
            
GameTextForPlayer(playerid"~y~You paid toll, drive carefull!~n~~r~$30"30003);
            
SetTimerEx("Timer_TollsClose",5000,false,"i"0);
        }
    }
}
public 
Timer_TollsClose(tollid)
{
    switch(
tollid)
    {
        case 
0MoveDynamicObject(toll11651.2354736328, -43.64343261718836.1392173767092.5); // LV toll-barrier open position
    
}

Reply
#9

Which lines are the error lines?
Reply
#10

Quote:
Originally Posted by jeremy8810
Посмотреть сообщение
hmm now im stuck...
Got this errors:

C:\Users\Jeremy\Desktop\World European Trucking Server\filterscripts\tolls-jer.pwn(41) : warning 215: expression has no effect
C:\Users\Jeremy\Desktop\World European Trucking Server\filterscripts\tolls-jer.pwn(41) : error 001: expected token: ";", but found ")"
C:\Users\Jeremy\Desktop\World European Trucking Server\filterscripts\tolls-jer.pwn(41) : error 029: invalid expression, assumed zero
C:\Users\Jeremy\Desktop\World European Trucking Server\filterscripts\tolls-jer.pwn(45) : error 029: invalid expression, assumed zero
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


3 Errors.

On this script:
PHP код:
#include <a_samp>
#include <streamer>
#include <foreach>
#define red 0xFF0000AA
new toll1;
forward Tolls();
forward Timer_TollsClose(tollid);
public 
OnFilterScriptInit()
{
    print(
"\n--------------------------------------");
    print(
"ToLLz By jeremy8810");
    print(
"--------------------------------------\n");
    
toll1 CreateDynamicObject(35781651.2354736328, -43.64343261718836.1392173767090021.5);         //toll-barrier start position (toll is closed)
    
CreateDynamicObject(38811657.2738037109, -38.7260742187537.2669296264650020.5);                //lv toll object
    
CreateDynamicObject(38811645.2979736328, -48.71124649047937.26692962646500201.24499511719);     //lv toll object
    
CreateDynamicObject(9781644.5096435547, -58.16750717163135.97201538085900272);                 //lv toll object
    
CreateDynamicObject(9791663.5103759766, -44.45117187535.93604278564500129.75);                 //lv toll object
    
CreateDynamicObject(9781656.4311523438, -30.88540267944335.9392280578610074);                 //lv toll object
    
CreateDynamicObject(9791638.6834716797, -43.44638824462935.92470550537100315);                //lv toll object
    
SetTimer("Tolls"1500true);
    return 
1;
}
public 
OnFilterScriptExit()
{
    return 
1;
}
public 
Tolls()
{
    foreach(
Playerplayerid)
    {
        if (
IsPlayerInRangeOfPoint(playerid15.01651.2354736328, -43.64343261718836.139217376709))
        
GetPlayerWantedLevel(playerid) > 3// Checks if wanted level is over 3..
        
{
        
SendClientMessage(playeridred"Your wanted level is 3 or higher, take another way!");
        }
        else
        {
            
MoveDynamicObject(toll11651.2353515625, -43.64257812534.4641151428222.5);
            
GivePlayerMoney(playerid, -30);
            
GameTextForPlayer(playerid"~y~You paid toll, drive carefull!~n~~r~$30"30003);
            
SetTimerEx("Timer_TollsClose",5000,false,"i"0);
        }
    }
}
public 
Timer_TollsClose(tollid)
{
    switch(
tollid)
    {
        case 
0MoveDynamicObject(toll11651.2354736328, -43.64343261718836.1392173767092.5); // LV toll-barrier open position
    
}

I no its old topic but why use what i made then basically change the name :S
https://sampforum.blast.hk/showthread.php?tid=280921
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)