toll (pay cash)
#1

Hi all,

I want to make moving toll ports in the begin of some bridges in SA.
I know how to create them but how can I make it that members need to pay like $50,- when they pass?

Srry for my english -___-

Thanks in advance..
Reply
#2

Elaborate. Have you already made them?

You should use a server-sided money system using variables to store money as opposed to GetPlayerMoney to prevent cheating.

pawn Код:
if(pCash[playerid] < 50) return SendClientMessage(playerid, COLOR_RED, "Toll: $50 - Insufficient Funds.");

// Take the funds and open the gate
pCash[playerid] -= 50;
GivePlayerMoney(playerid, -50);
To trigger it, I would personally create an invisible pickup (ID 19300) that is pickupable from vehicles (pickup type 14) so that when they pull up to the toll booth it triggers OnPlayerPickUpPickup. This is a more efficient way than constant IsPlayerInRangeOfPoint checks.
Reply
#3

Код:
#include <a_samp>
Код:
new port;
new timer[MAX_PLAYERS];
Код:
forward closeport();
Код:
public OnGameModeInit()
{
port = CreateObject(port_id, float_x, float_y, float_z, 0, 0, 0);
}
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/openport", cmdtext, true, 10) == 0)
{
if(IsPlayerInRangeOfPoint(playerid, distance, float_x, float_y, float_z)) // affect when the player is near
{
if(GetPlayerMoney(playerid) < 50) // check if the player has the money
{
SendClientMessage(playerid, 0xFFFFFFFF, "You dont have enough moneys");
}
else // if the player have the moneys execute the cmd
{
GivePlayerMoney(playerid, -50);  // this set the amount he need to pay to use it
MoveObject(port, float_x, float_y, float_z, speed);
SendClientMessage(playerid, 0xFFFFFFFF, "You paid $50 to open the port. Autoclose in 10 seconds");
timer[playerid] = SetTimerEx("closeport",10000,false,"i",playerid); // timer to autoclose the port
}
}
}
return 1;
}
Код:
public closeport()
{
MoveObject(port, float_x, float_y, float_z, speed); // set this to coordinates you got on OnGameModeInit()
}
this will create an automatic port on the defined float_x float_y and float_z, also it request 50$ to use the command.

i did it quickly so i didnt checked it, but i guess it will work, feel free anyone to fix me if i wrong anything.

cya
Reply
#4

My method is better. Commands are stupid.
Reply
#5

Quote:
Originally Posted by MP2
Посмотреть сообщение
My method is better. Commands are stupid.
He asked a way to do it, i gived him a way to do it.

What's the problem? I'm not allowed to help a user?

Seriosly man, avoid to flame the topic. thanks.
Reply
#6

Thanks both :_)
Will try to use them..

Does anyone know if there already is an FS for this?
Since im not the best scripter haha xD
Reply
#7

He already said he knows how to create the gate, so your post is worthless. All he wants to know if how to charge a player, to which I replied already. Your reply is totally un-necessary.
Reply
#8

Quote:
Originally Posted by MP2
Посмотреть сообщение
He already said he knows how to create the gate, so your post is worthless. All he wants to know if how to charge a player, to which I replied already. Your reply is totally un-necessary.
Do a favour to me and krypto. gtfo this topic you arrogant idiot

Quote:
Originally Posted by kryptonice
Посмотреть сообщение
Thanks both :_)
Will try to use them..

Does anyone know if there already is an FS for this?
Since im not the best scripter haha xD
i'll made for u the script, all you need to do is paste in on a new filterscript file all you need to change for FS is the code

Код:
public OnFilterScriptInit()
{
Reply
#9

I replied first with all the information he needed, yet you feel the need to reply also. Ironic. Look who's being arrogant.

P.S. I'm not an idiot, I'm fairly confident that I know more than you.
Reply
#10

Quote:
Originally Posted by MP2
Посмотреть сообщение
I replied first with all the information he needed, yet you feel the need to reply also. Ironic. Look who's being arrogant.
You didnt even helped him at all.

he said he's not good scripting, and you talk to him about pickups and other shit's, how the hell he suppose to get it easy?

just gtfo you and your arrogant reply's.

PS: so you just said "i replied first", ok you won the idiot's cup, now let other help him. your just flooding.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)