GetPlayerMoneyHelp
#1

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?
Reply
#2

if(GetPlayerMoney(playerid) >= 20000)
{

}

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

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....
Reply
#4

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.
Reply
#5

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....
Reply
#6

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.
Reply
#7

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..
Reply
#8

Anyone?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)