Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 02-04-2002, 08:17 PM
joseyisleet joseyisleet is offline
Registered User
Join Date: Aug 2001
Posts: 378
joseyisleet is on a distinguished road
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?'
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 01:40 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.