Toll system, needed -
jeremy8810 - 01.07.2012
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!
Re: Toll system, needed -
Dan. - 01.07.2012
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.
Re: Toll system, needed -
jeremy8810 - 01.07.2012
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.
Re: Toll system, needed -
Dan. - 01.07.2012
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.
Re: Toll system, needed -
MadeMan - 01.07.2012
You can learn from existing scripts
http://forum.sa-mp.com/search.php?searchid=4823159
Re: Toll system, needed -
LaGrande - 01.07.2012
use IsPlayerInRangeOfPoint, then check if the player is wanted, if not deduct the cash and let him go.
Re: Toll system, needed -
jeremy8810 - 01.07.2012
Thanks thanks, I will give it a try!
Re: Toll system, needed -
jeremy8810 - 01.07.2012
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(3578, 1651.2354736328, -43.643432617188, 36.139217376709, 0, 0, 21.5); //toll-barrier start position (toll is closed)
CreateDynamicObject(3881, 1657.2738037109, -38.72607421875, 37.266929626465, 0, 0, 20.5); //lv toll object
CreateDynamicObject(3881, 1645.2979736328, -48.711246490479, 37.266929626465, 0, 0, 201.24499511719); //lv toll object
CreateDynamicObject(978, 1644.5096435547, -58.167507171631, 35.972015380859, 0, 0, 272); //lv toll object
CreateDynamicObject(979, 1663.5103759766, -44.451171875, 35.936042785645, 0, 0, 129.75); //lv toll object
CreateDynamicObject(978, 1656.4311523438, -30.885402679443, 35.939228057861, 0, 0, 74); //lv toll object
CreateDynamicObject(979, 1638.6834716797, -43.446388244629, 35.924705505371, 0, 0, 315); //lv toll object
SetTimer("Tolls", 1500, true);
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
public Tolls()
{
foreach(Player, playerid)
{
if (IsPlayerInRangeOfPoint(playerid, 15.0, 1651.2354736328, -43.643432617188, 36.139217376709))
GetPlayerWantedLevel(playerid) > 3) // Checks if wanted level is over 3..
{
SendClientMessage(playerid, red, "Your wanted level is 3 or higher, take another way!");
}
else
{
MoveDynamicObject(toll1, 1651.2353515625, -43.642578125, 34.464115142822, 2.5);
GivePlayerMoney(playerid, -30);
GameTextForPlayer(playerid, "~y~You paid toll, drive carefull!~n~~r~$30", 3000, 3);
SetTimerEx("Timer_TollsClose",5000,false,"i", 0);
}
}
}
public Timer_TollsClose(tollid)
{
switch(tollid)
{
case 0: MoveDynamicObject(toll1, 1651.2354736328, -43.643432617188, 36.139217376709, 2.5); // LV toll-barrier open position
}
}
Re: Toll system, needed -
Dan. - 01.07.2012
Which lines are the error lines?
Respuesta: Re: Toll system, needed -
[LHT]Bally - 19.01.2013
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(3578, 1651.2354736328, -43.643432617188, 36.139217376709, 0, 0, 21.5); //toll-barrier start position (toll is closed)
CreateDynamicObject(3881, 1657.2738037109, -38.72607421875, 37.266929626465, 0, 0, 20.5); //lv toll object
CreateDynamicObject(3881, 1645.2979736328, -48.711246490479, 37.266929626465, 0, 0, 201.24499511719); //lv toll object
CreateDynamicObject(978, 1644.5096435547, -58.167507171631, 35.972015380859, 0, 0, 272); //lv toll object
CreateDynamicObject(979, 1663.5103759766, -44.451171875, 35.936042785645, 0, 0, 129.75); //lv toll object
CreateDynamicObject(978, 1656.4311523438, -30.885402679443, 35.939228057861, 0, 0, 74); //lv toll object
CreateDynamicObject(979, 1638.6834716797, -43.446388244629, 35.924705505371, 0, 0, 315); //lv toll object
SetTimer("Tolls", 1500, true);
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
public Tolls()
{
foreach(Player, playerid)
{
if (IsPlayerInRangeOfPoint(playerid, 15.0, 1651.2354736328, -43.643432617188, 36.139217376709))
GetPlayerWantedLevel(playerid) > 3) // Checks if wanted level is over 3..
{
SendClientMessage(playerid, red, "Your wanted level is 3 or higher, take another way!");
}
else
{
MoveDynamicObject(toll1, 1651.2353515625, -43.642578125, 34.464115142822, 2.5);
GivePlayerMoney(playerid, -30);
GameTextForPlayer(playerid, "~y~You paid toll, drive carefull!~n~~r~$30", 3000, 3);
SetTimerEx("Timer_TollsClose",5000,false,"i", 0);
}
}
}
public Timer_TollsClose(tollid)
{
switch(tollid)
{
case 0: MoveDynamicObject(toll1, 1651.2354736328, -43.643432617188, 36.139217376709, 2.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