Graal Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 06-23-2002, 04:29 AM
Legondary_MyTH Legondary_MyTH is offline
Registered User
Join Date: May 2002
Location: Levelville
Posts: 420
Legondary_MyTH is on a distinguished road
Talking A little help plz

I have a bar script so when you buy the beer it takes 5 rupees and puts it in a NPC so the owner of the bar can get it when he/she touches it. the problem is when you press enter it drops money everytime .the script works its just the money that keeps coming out. here is the sript plz help.

// NPC made by MyTH
if (playerenters){hidelocal; dontblock;}
if (playerchats&&strequals(#c,beer 1)&& playerrupees>=5) {playerrupees = playerrupees-5;
move -2,0,2,0;show;blockagain;}
if (playertouchsme) putleaps 5,playerx,playery;playerhearts +=2;
if (playertouchsme) hide;lay2 bluerupee,32,25;
__________________
ArchMage Amedeus Valoryn of Zormite
Manager of Anarchy
Past Jobs:
Levels Admin on Renegade
LAT on Doomsday,Babylon,G3K
Developer on Faheria,Babylon
GP on Sanstrata,G3K
Reply With Quote
  #2  
Old 06-25-2002, 11:19 AM
Torankusu Torankusu is offline
Elite Member
Torankusu's Avatar
Join Date: Jun 2001
Posts: 10,065
Torankusu is a jewel in the roughTorankusu is a jewel in the rough
This might help.

NPC Code:
//Get the bar money, etc.
if (playerchats) {
allow=false;
{
if (strequals(#a,Account) || strequals(#g,Bar Tender)) allow=true; //Allows this guild/account to withdraw the money.
barmoney=strtofloat(#s(this.barmoney));
}
if (strequals(#c,show money)) setcharprop #c,The bar has collected #v(barmoney) rupees.;
if (startswith(collect,#c)) { //Checks player's text to see if it starts with "collect."
if (allow==false) setcharprop #c,You can't collect any money.; //Self Explainatory.
else {
total=strtofloat(#e(8,-1,#c)); //#e = carries the eight characters (collect,) , -1, I forget, #c, withdraws the character's # amount.
if (total>0&&total<=barmoney) {
barmoney-=total; //Subtracts the money from the bar total.
playerrupees+=total; //Adds the money to the bar total.
setcharprop #c, } else { //If the bar doesn't have that much money--
if (total<0) setcharprop #c,You must say a number greater then 0!;
else setcharprop #c,The bar doesn't have that much money!;
}
}
}
setstring this.barmoney,#v(barmoney);
}



And... I'd do this with the beer...
NPC Code:

//NPC made by Torankusu
if (playerenters) {
hide;}
if (playerchats && strequals(#c,buy beer 1)) {
playerrupees-=5;
setstring this.barmoney,#v(strtofloat(#s(this.barmoney))+5); //Adds to the bar money.
show;}
if (playertouchsme) {
playerhearts+=2;
putleaps 5,playerx,playery;
hide;
}



I suggest you put the bar collect stuff in a separate NPC.
__________________
Quote:
Originally posted by Spark910
Think befreo you type.
Reply With Quote
  #3  
Old 06-25-2002, 11:39 AM
Legondary_MyTH Legondary_MyTH is offline
Registered User
Join Date: May 2002
Location: Levelville
Posts: 420
Legondary_MyTH is on a distinguished road
Thanks!

Yea thanks alot it works fine!
__________________
ArchMage Amedeus Valoryn of Zormite
Manager of Anarchy
Past Jobs:
Levels Admin on Renegade
LAT on Doomsday,Babylon,G3K
Developer on Faheria,Babylon
GP on Sanstrata,G3K
Reply With Quote
  #4  
Old 06-25-2002, 11:42 AM
Torankusu Torankusu is offline
Elite Member
Torankusu's Avatar
Join Date: Jun 2001
Posts: 10,065
Torankusu is a jewel in the roughTorankusu is a jewel in the rough
learn off of it. Those commands can come in handy.

Oh yeah.

(#e(8,-1,#c) --- In that, -1 means go all the way to the end of the player's chat text.
__________________
Quote:
Originally posted by Spark910
Think befreo you type.
Reply With Quote
  #5  
Old 06-25-2002, 11:49 AM
Legondary_MyTH Legondary_MyTH is offline
Registered User
Join Date: May 2002
Location: Levelville
Posts: 420
Legondary_MyTH is on a distinguished road
Crap

I didnt check the top 1 i just added the beer the top one doesnt work for me i ut my account and changed the guild to Police cause that was my nick and i am to lazy for setplayerprop #n,Name;}

????????????????????!!!!!!!!!!!!!!!
__________________
ArchMage Amedeus Valoryn of Zormite
Manager of Anarchy
Past Jobs:
Levels Admin on Renegade
LAT on Doomsday,Babylon,G3K
Developer on Faheria,Babylon
GP on Sanstrata,G3K
Reply With Quote
  #6  
Old 06-25-2002, 12:33 PM
Torankusu Torankusu is offline
Elite Member
Torankusu's Avatar
Join Date: Jun 2001
Posts: 10,065
Torankusu is a jewel in the roughTorankusu is a jewel in the rough
Re: Crap

Quote:
Originally posted by Legondary_MyTH
I didnt check the top 1 i just added the beer the top one doesnt work for me i ut my account and changed the guild to Police cause that was my nick and i am to lazy for setplayerprop #n,Name;}

????????????????????!!!!!!!!!!!!!!!
?

The top one works.
__________________
Quote:
Originally posted by Spark910
Think befreo you type.
Reply With Quote
  #7  
Old 06-25-2002, 12:48 PM
Saga2001 Saga2001 is offline
Wishing he had 3 feet
Join Date: Aug 2001
Location: Basement
Posts: 1,565
Saga2001 is on a distinguished road
Send a message via ICQ to Saga2001 Send a message via AIM to Saga2001 Send a message via Yahoo to Saga2001
Quote:
Originally posted by Torankusu
learn off of it. Those commands can come in handy.

Oh yeah.

(#e(8,-1,#c) --- In that, -1 means go all the way to the end of the player's chat text.
*proud of his artistry of teaching this boy to be a man and use the #e() string manipulator*
__________________

!Wan ( 11:27:55 AM):
can i c ur scripts please?
Zorg (RC): If I hear NPC Server call Ne0, Past Austin or Brent sexy one more time im disconnecting it
Reply With Quote
  #8  
Old 06-25-2002, 12:52 PM
Torankusu Torankusu is offline
Elite Member
Torankusu's Avatar
Join Date: Jun 2001
Posts: 10,065
Torankusu is a jewel in the roughTorankusu is a jewel in the rough
Quote:
Originally posted by Saga2001


*proud of his artistry of teaching this boy to be a man and use the #e() string manipulator*
Thanks.
__________________
Quote:
Originally posted by Spark910
Think befreo you type.
Reply With Quote
  #9  
Old 06-26-2002, 06:45 AM
Legondary_MyTH Legondary_MyTH is offline
Registered User
Join Date: May 2002
Location: Levelville
Posts: 420
Legondary_MyTH is on a distinguished road
hrm

Doesnt work for me i put it in the man behind the bar you have to have the Bar tender tag to get to him and i said collect #
__________________
ArchMage Amedeus Valoryn of Zormite
Manager of Anarchy
Past Jobs:
Levels Admin on Renegade
LAT on Doomsday,Babylon,G3K
Developer on Faheria,Babylon
GP on Sanstrata,G3K
Reply With Quote
  #10  
Old 06-26-2002, 07:16 AM
Torankusu Torankusu is offline
Elite Member
Torankusu's Avatar
Join Date: Jun 2001
Posts: 10,065
Torankusu is a jewel in the roughTorankusu is a jewel in the rough
Contact me over AIM or post the level.
shady visions

That's weird.
__________________
Quote:
Originally posted by Spark910
Think befreo you type.
Reply With Quote
  #11  
Old 06-26-2002, 11:39 AM
Legondary_MyTH Legondary_MyTH is offline
Registered User
Join Date: May 2002
Location: Levelville
Posts: 420
Legondary_MyTH is on a distinguished road
*dies*

AHHHHHHHH ok now the beer when you say beer 1 it slides to you right? well i touch it it goes away like supposed to.I say beer 1 again and it slides from where it ended the last time and it keeps going father everytime you say beer 1!!!!*pulls hair out*
__________________
ArchMage Amedeus Valoryn of Zormite
Manager of Anarchy
Past Jobs:
Levels Admin on Renegade
LAT on Doomsday,Babylon,G3K
Developer on Faheria,Babylon
GP on Sanstrata,G3K
Reply With Quote
Reply


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 09:03 AM.


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