Really simple and probably really stupid bank:
NPC Code:
if (playerchats) {
tokenize #c;
if (strequals(#t(0),deposit)) {
if (strtofloat(#t(1))<1) setplayerprop #c,You must type a number bigger then 0;
else if (strtofloat(#t(1))>playerrupees) setplayerprop #c,You don't have that much money!;
else {
setstring client.moneydeposited,#v(strtofloat(#s(client.mone ydeposited))+strtofloat(#t(1)));
playerrupees-=strtofloat(#t(1));
setplayerprop #c,You now have #v(strtofloat(#s(client.moneydeposited)) gralats on the bank;
}
}
if (strequals(#t(0),withdraw)) {
if (strtofloat(#t(1))<1) setplayerprop #c,You must type a number bigger then 0;
else if (strtofloat(#t(1))>strtofloat(#s(client.moneydepos ited))) setplayerprop #c,You don't have that much money on the bank!;
else {
setstring client.moneydeposited,#v(strtofloat(#s(client.mone ydeposited))-strtofloat(#t(1)));
playerrupees+=strtofloat(#t(1));
setplayerprop #c,You now have #v(strtofloat(#s(client.moneydeposited)) gralats on the bank;
}
}
if (strequals(#c,bank balance)) setplayerprop #c,You have #v(strtofloat(#s(client.moneydeposited)) gralats on the bank;
}