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



GetPlayerMoneyHelp - Vege - 25.09.2013

So,
I am making a banking system for my server and i need some help,

what i want is that if someone deposits or robs some other guy's bank account the other guy gets an alert if the deposit/rob thingy is greater than 20000(twenty thousand) cash.

what i know is that we would use gettime() maybe?
I seriously am stuck if anyone could help?


Re: GetPlayerMoneyHelp - ic3cr3am - 25.09.2013

if(GetPlayerMoney(playerid) >= 20000)
{

}

hope you not noob, and that you will be able to use this code


Re: GetPlayerMoneyHelp - Vege - 25.09.2013

Quote:
Originally Posted by ic3cr3am
Посмотреть сообщение
if(GetPlayerMoney(playerid) >= 20000)
{

}

hope you not noob, and that you will be able to use this code
I Know that i need help with the gettime function....
Sorry i realised now that i didnt specify it....and set the thread title to something idiotic in the sense of the help i needed....
Anyone else is also requested to help....


Re: GetPlayerMoneyHelp - DanishHaq - 25.09.2013

gettime() comes as a unix timestamp, however, by using gettime like as follows, you can get the exact hour, minute and second:

pawn Код:
new hours, minutes, seconds;
gettime(hours, minutes, seconds);
And then you can use those for anything in your command or callback or whatever you want to use it for. Here's an example:

pawn Код:
CMD:time(playerid, params[], help)
{
    new hours, minutes, seconds, string[50];
    gettime(hours, minutes, seconds);
    format(string, sizeof(string), "The time is %d hours, %d minutes and %d seconds.", hours, minutes, seconds);
    SendClientMessage(playerid, 0xFFFFFFFF, string);
    return 1;
}
A Unix Timestamp is used on SA-MP mainly for temporary systems, you can see more about the unix timestamp here: http://en.wikipedia.org/wiki/Unix_time, and you can see how to use it in SA-MP here: https://sampforum.blast.hk/showthread.php?tid=254915.


Re: GetPlayerMoneyHelp - Vege - 25.09.2013

what if i only use gettime() instead of gettime(hours, minutes, seconds); ?
I actually want to use the gettime() func as so that if the money change in a bank acc is greater than 20000 then within 2-3 seconds the player who bank acc it is gets an alert....


Re: GetPlayerMoneyHelp - DanishHaq - 25.09.2013

Quote:
Originally Posted by Vege
Посмотреть сообщение
what if i only use gettime() instead of gettime(hours, minutes, seconds); ?
Then it's a Unix Timestamp, as I said in my previous post. But, if you do want to convert it into a normal time, you must get all the values (hours, minutes, seconds), even though if you're not going to use all of them.


Re: GetPlayerMoneyHelp - Vege - 25.09.2013

Quote:
Originally Posted by Vege
Посмотреть сообщение
what if i only use gettime() instead of gettime(hours, minutes, seconds); ?
I actually want to use the gettime() func as so that if the money change in a bank acc is greater than 20000 then within 2-3 seconds the player who bank acc it is gets an alert....
I think someone might wanna review my edit and shukria(Thanks) Danish..


Re: GetPlayerMoneyHelp - Vege - 27.09.2013

Anyone?