SA-MP Forums Archive
Whats Wrong - 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: Whats Wrong (/showthread.php?tid=515722)



Whats Wrong - youssefehab500 - 27.05.2014

this is an atm fs supposed when im near the atm the atm dialog activates i did it before with a checkpoint but i wanted one without an icon in map so thought of this here is he code doesnt have any errors but doesnt work in game when i go to the atm help me

stock IsNearATM(playerid, Float:range = 1.5)
{
new Float, Float:y, Float:z;
GetObjectPos(ATM1, x, y, z);
if(IsPlayerInRangeOfPoint(playerid, range, x, y ,z))
{
ShowPlayerDialog(playerid,1125,DIALOG_STYLE_LIST," San Fierro ATM","Deposit\nWithdraw\nBalance","Select","Cancel ");
SetPlayerHealth(playerid, 99999);
return 1;
}
else
{
SetPlayerHealth(playerid, 100);
return 1;
}
return 0;
}


Re: Whats Wrong - R0 - 27.05.2014

show ATM1's script


Re: Whats Wrong - youssefehab500 - 27.05.2014

and other thing i want when in in range my health is infinity as in god mode and when i finish using atm and out of range my life becoms 100 i did all that with checkpoint but cant seem to work here :/


Re: Whats Wrong - youssefehab500 - 27.05.2014

Quote:
Originally Posted by R0
Посмотреть сообщение
show ATM1's script
all the fs??


Re: Whats Wrong - gekas - 27.05.2014

Just Atm Code


Re: Whats Wrong - youssefehab500 - 27.05.2014

new pInfo[MAX_PLAYERS][PLAYER_MAIN];
new chosenpid;
new ATM1;

public OnFilterScriptInit()
{
ATM1 = CreateObject(2942, -2029.1999511719, 454.54998779297, 34.799999237061, 0, 0, 180);
SetTimer("Contack",1,0);
return 1;
}
this is the atm the other stuff are the tele and the system of it the dialog the save money the main idea of this atm is it saves ur money u can deposit,withdraw,and see ur balance and saves with mysql in a folder bank in scriptfiles thats it


Re: Whats Wrong - Konstantinos - 27.05.2014

Having the function does nothing. Do you actually call it somewhere?

And by the way, setting the health to 100 everytime a player is not in range of the point is bad. Just set it after they close the dialog.


Re: Whats Wrong - youssefehab500 - 27.05.2014

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
Having the function does nothing. Do you actually call it somewhere?

And by the way, setting the health to 100 everytime a player is not in range of the point is bad. Just set it after they close the dialog.
hmmm wanna see the whole script of the atm its a script for atm only like 120 lines http://pastebin.com/ypfMy9ww


Re: Whats Wrong - youssefehab500 - 27.05.2014

no hope or wht xD


Re: Whats Wrong - YoungKris - 27.05.2014

you shouldn't set the health back to 100, lets say the player has 20hp and he quickly uses the atm to gain 100hp.

you should use something called https://sampwiki.blast.hk/wiki/GetPVarFloat to store the HP and then use https://sampwiki.blast.hk/wiki/SetPVarFloat.