Well, you don’t need to strtofloat variables. As it says, it converts strings to floating values, and since it’s not a string… well, it’s not needed
On the withdraw some:
if(strtofloat(#s(client.bankaccount)) <= strtofloat(#t(1))){
Would imply a check that makes sure the bank amount is less than the withdraw amount?
You also forgot checks for if the withdraw is greater than 0, and handling decimals.
___Merged doublepost__________________
Edited it some for you:
[code]//#CLIENTSIDE
if (created||playerenters) {
// Initialize the attributes
timereverywhere; // ALLOW TIMEOUTS FOR EACH PLAYER… NEVER USED THIS BEFORE
x += .5;
showcharacter;
setcharprop #3,head2.png;
setcharprop #C0,white;
setcharprop #C1,white;
setcharprop #C2,orange;
setcharprop #C3,lightblue;
setcharprop #C4,lightblue;
setcharprop #n,Bank Teller;
setcharprop #2,no-shield.gif;
shieldpower = 1;
dir = 2;
message;
this.oldbalance = strtofloat(#s(client.bankaccount)); // RECORD PREVIOUS BALANCE
}
if (playerchats) {
tokenize #c;
this.chkammount = abs(int(strtofloat(#t(1)))); // GET ABSOLUTE VALUE AND ELIMINATE FLOATING POINT
if (strequals(#t(0),deposit)) {
// CHECK DEPOSIT
if (strequals(#t(1),all)) {
if (playerrupees > 0) {
setstring client.bankaccount,#v(strtofloat(#s(client.bankaccount)) + playerrupees);
playerrupees = 0;
} else message You have no money!;
} else {
if (this.chkammount <= playerrupees && playerrupees > 0) {
setstring client.bankaccount,#v(strtofloat(#s(client.bankaccount)) + this.chkammount);
playerrupees -= this.chkammount;
} else message You don’t have enough money!;
}
// END DEPOSIT WITHDRAW
} else if (strequals(#t(0),withdraw)) {
// CHECK WITHDRAW
if (strequals(#t(1),all)) {
if (strtofloat(#s(client.bankaccount)) > 0) {
setstring client.bankaccount,0;
playerrupees += strtofloat(#s(client.bankaccount));
} else message No money in your account!;
} else {
if (this.chkammount > 0) {
if (strtofloat(#s(client.bankaccount)) - this.chkammount > 0) {
setstring client.bankaccount,#v(strtofloat(#s(client.bankaccount)) - this.chkammount);
playerrupees += this.chkammount;
} else message Not enough money in your account!;
} else message Invalid amount!;
}
}
// CHECK IF PLAYER HAS ASKED FOR BALANCE OR BALANCE HAS CHANGED
if (strequals(#c,balance) || strtofloat(#s(client.bankaccount)) != this.oldbalance) {
message Balance : #s(client.bankaccount) Rupees; // IF SO, LET PLAYER KNOW THEIR BALANCE
}
timeout = 3; // AFTER THREE SECONDS, CLEAR CHAT WITH TIMEOUT
this.oldbalance = strtofloat(#s(client.bankaccount)); // RECORD NEW BALANCE
}
I think they could be useful in situation where players don’t want to risk losing their moneys to pkers when making a trip to the store, especially since Xoria is set to make you spit up the max amount of rupees/gralets when you die (I think its only natural a person who kills you should be able to take everything not only a set variable of what you had on you -_-). That and it saves a trip to the bank.
Eh, I got the impression those bank cards are from Classic… and the bank card had no purpose other than to trigger the ATM at the bank… so you still had to go to the store.
edit: yup, it IS… so ya, what’s your point? You still gotta go to the bank to use the bank card.
My intention is not to make the bank card like that on classic… I posted that script in this thread purely for anyone who might want to look at it for an example. O.o
My intention with the bank card is EXACTLY what i described in my post above. To be used at shops as an alternative to carrying rupees. What is your point?
I suspected as much considering all of the crap Stefanie has been involved with ie scare tactics and general fagotry from her. Probably not the wisest idea to use the same identifiers such as signatures. Or unless your not that person in which case your framing them.