ATM System - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: ATM System (
/showthread.php?tid=159252)
ATM System -
fmmalves - 12.07.2010
How can i put an ATM Systen in my server...
HELP ME =D
Re: ATM System -
MikkelGutten - 12.07.2010
Did you try to search?
Re: ATM System -
fmmalves - 12.07.2010
Yes but i want your advices about that....
What is better, the functions, etc...
Re: ATM System -
DJDhan - 12.07.2010
You mean Automatic Teller Machines where players can withdraw cash?
Re: ATM System -
MikkelGutten - 12.07.2010
Quote:
Originally Posted by DJDhan
You mean Automatic Teller Machines where players can withdraw cash?
|
Yes he does. He means "Automatic Teller Machines" a.k.a. "ATM".
Re: ATM System -
fmmalves - 12.07.2010
yes PLEASE HELP!!!
Re: ATM System -
Grim_ - 12.07.2010
Just make the object for the ATM.
Then when you make a command, like /withdraw, check if they're near it using IsPlayerInRangeOfPoint().
If they are, give them the money if it's less than what they have in their bank account.
Most of the code will have to be done by you because we do not know how you save the amount of cash the player has, or the variables used.
Re: ATM System -
DJDhan - 12.07.2010
Well I don't know the object id of the ATM machine but you can find it out.
Use the following functions:
Код:
new atm = CreateObject(...................);
CreateObject @ the WIKI
Then check if the player is near an ATM machine where you have the command for the withrawal.
Код:
if(!strcmp(cmdtext,"/withdraw",true))
{
new Float:x,Float:y,Float:z;
GetPlayerPos(playerid,x,y,z);
if(!IsPlayerInRangeOfPoint(playerid,xofatm,yofatm,zofatm,range)) return SendClientMessage(playerid,0xffffffaa,"You are not near an ATM.");
//rest of the code
return 1;
}
IsPlayerInRangeOfPoint @ the WIKI
EDIT: Yea like Grim_ said.
Re: ATM System -
fmmalves - 12.07.2010
I Have crieted 1 ATM.
I dont have the command to work.
If i put this:
if(!strcmp(cmdtext,"/withdraw",true))
{
new Float
,Float:y,Float:z;
GetPlayerPos(playerid,x,y,z);
if(!IsPlayerInRangeOfPoint(playerid,xofatm,yofatm, zofatm,range)) return SendClientMessage(playerid,0xffffffaa,"You are not near an ATM.");
//rest of the code
return 1;
}
This will work?? and where is the command to trasnfere etc....
Re: ATM System -
Grim_ - 12.07.2010
You'll need to add the code to give the player the money and change the values of 'xofatm', 'yofatm' etc to the actual coordinates of where you added the ATM.