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
  #2  
Old 01-12-2009, 08:20 PM
Codein Codein is offline
jwd
Codein's Avatar
Join Date: Oct 2005
Location: Greater Manchester
Posts: 2,423
Codein has a spectacular aura aboutCodein has a spectacular aura about
Send a message via AIM to Codein Send a message via MSN to Codein
Quote:
Originally Posted by [email protected] View Post
stuff
-Jamerson61894
You have to use a DB NPC for it save. Basically, using NC, create NPC in the same position where this script is, and copy and paste the script inside it. Then delete level NPC.

I don't really like how you've combined events and flags. I think that's a bit of a taboo and shouldn't be done. Do this:

HTML Code:
if (playerchats) {
	tokenize #c;
	
	if (strcontains(#c,/withdraw)) {
		this.takemoney = strtofloat(#t(1));
		if (this.safemoney >= this.takemoney){
			if (this.takemoney > 0){
				if (strequals(#a,GULTHEX)){
					playerrupees += this.takemoney;
					this.safemoney -= this.takemoney;
					setplayerprop #c, Took #v(this.takemoney) dollars out of safe!;
					setcharprop #c, #v(this.safemoney) dollars in safe!
	            }
			}
		}
	}
	
	elseif (strcontains(#c, /deposit)) {
		this.rupeeadd = strtofloat(#t(1));
		if (playerrupees >= this.rupeeadd){
			if (this.rupeeadd > 0){
				playerrupees -= this.rupeeadd;
				this.safemoney += this.rupeeadd;
				setcharprop #c,#v(this.safemoney) dollars in safe!;
			}
		}
	}
	
	elseif (strcontains(#c, /balance)) {
		setcharprop #c, #v(this.safemoney) dollars in safe!
	}
}

if (timeout){
  setcharprop #c, ;
}
Also, try learning GS2
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 06:46 AM.


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