Thread: Good Bank
View Single Post
  #4  
Old 06-19-2001, 03:47 PM
grim_squeaker_x grim_squeaker_x is offline
Retired Oldbie
grim_squeaker_x's Avatar
Join Date: Mar 2001
Posts: 3,084
grim_squeaker_x will become famous soon enough
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;
}

__________________

Reply With Quote