
02-04-2002, 08:17 PM
|
|
Registered User
|
Join Date: Aug 2001
Posts: 378
|
|
Personal bank script.
|
-=Josey=-
Ok, a friend asked me to make this for him. You may not edit this code, use it to get hired on a server, or use it on your own server without asking me and getting my express written consent. This code is merely for learning purposes.
// NPC made by Josey Hunt
if (playerenters) {
toweapons Items/Bank;
}
if (weaponfired){
say2 This is your personal bank!#bCommands are:#bdeposit <ammounthere>:deposits.#bwithdraw <ammounthere>:deposits.#bShow banked gralat:shows your#bgralat in your bank.#bThat's all!;
}
if (isweapon){
if (playerchats){
if (startswith(withdraw,#c)){
tokenize #c;
if (tokenscount==2){
if (strtofloat(#s(client.banked))=>strtofloat(#t(1))) {
playerrupees+=strtofloat(#t(1));
setstring client.banked,#v(strtofloat(#s(client.banked))-strtofloat(#t(1)));
setplayerprop #c,You withdraw #t(1) from your bank. You now have #s(client.banked) gralat left in your bank.;
}
if (!strtofloat(#s(client.banked))=>strtofloat(#t(1)) ){
setplayerprop #c,You dont have #t(1) gralat in the bank!;
}
}
}
if (startswith(deposit,#c)){
tokenize #c;
if (tokenscount==2){
if (strtofloat(#v(playerrupees))=>strtofloat(#t(1))){
playerrupees-=strtofloat(#t(1));
setstring client.banked,#v(strtofloat(#s(client.banked))+str tofloat(#t(1)));
setplayerprop #c,You deposited #t(1) into your bank. You now have #s(client.banked) gralat in your bank.;
}
}
}
if (strequals(#c,show banked gralat)){
setplayerprop #c,You have #s(client.banked) gralat in your bank.;
}
}
}
I know it's not the best, but, it works. ;D |
__________________
Account used by Josey and Howard.
Ali G: 'Is it cause i Black?'
|
|
|
|