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 01-20-2002, 04:43 PM
lordhelmut lordhelmut is offline
Registered User
lordhelmut's Avatar
Join Date: Aug 2001
Posts: 710
lordhelmut is on a distinguished road
Send a message via ICQ to lordhelmut Send a message via AIM to lordhelmut Send a message via Yahoo to lordhelmut
PlayerHouse script

// NPC made by Lord Helmut
if(created){
this.max=7;
}
if(playerchats) {
tokenize #c;
if (strequals(#t(0),AddTenant)){
tokenize server.p1htenants;
if(strequals(#a,#t(0))){
if (tokenscount<=this.max) {
tokenize #c;
addstring server.ph1tenants,#t(1);
}else{
message You already have #v(this.max) tenants!;
}
}
}
}

What would I change to add to that so that the owner can also say RemoveTenant 1 or 2 or whatever?
Reply With Quote
  #2  
Old 01-20-2002, 06:01 PM
joseyisleet joseyisleet is offline
Registered User
Join Date: Aug 2001
Posts: 378
joseyisleet is on a distinguished road
uhhh
if (playerchats&&strequals(#a,#s(this.owner))&&strequ als(#c,remove 1)){
deletestring tennant1,;}


something like that?
__________________
Account used by Josey and Howard.
Ali G: 'Is it cause i Black?'
Reply With Quote
  #3  
Old 01-21-2002, 12:19 AM
lordhelmut lordhelmut is offline
Registered User
lordhelmut's Avatar
Join Date: Aug 2001
Posts: 710
lordhelmut is on a distinguished road
Send a message via ICQ to lordhelmut Send a message via AIM to lordhelmut Send a message via Yahoo to lordhelmut
I think that might work =D accept is it delete or removestring
Reply With Quote
  #4  
Old 01-21-2002, 04:00 AM
Shard_IceFire Shard_IceFire is offline
Registered User
Shard_IceFire's Avatar
Join Date: Jun 2001
Location: Eastern Harkoonia
Posts: 861
Shard_IceFire is on a distinguished road
What if you want to do a showimg list?
Like say you have this:
client.tenants=Bob,Frank,Joey,Ted
how do you turn it into a showimg thing of this:
Tenants:
Bob
Frank
Joey
Ted

-------

Also, how would you make it so there is a max amount of tenants?
__________________

-=Shard IceFire=-
Reply With Quote
  #5  
Old 01-21-2002, 09:09 AM
lordhelmut lordhelmut is offline
Registered User
lordhelmut's Avatar
Join Date: Aug 2001
Posts: 710
lordhelmut is on a distinguished road
Send a message via ICQ to lordhelmut Send a message via AIM to lordhelmut Send a message via Yahoo to lordhelmut
if you look at the script i made, you see it says this.max=7 meaning as long as the list is <= 7 its ok. When it exceeds it, it wont add anymore
Reply With Quote
  #6  
Old 01-23-2002, 01:26 AM
lordhelmut lordhelmut is offline
Registered User
lordhelmut's Avatar
Join Date: Aug 2001
Posts: 710
lordhelmut is on a distinguished road
Send a message via ICQ to lordhelmut Send a message via AIM to lordhelmut Send a message via Yahoo to lordhelmut
// NPC made by Lord Helmut
if(created){
this.max=7;
}
if(playerchats) {
tokenize #c;
if (strequals(#t(0),AddTenant)){
tokenize #s(server.ph1tenants);
if(strequals(#a,#t(0))){
if (tokenscount<=this.max) {
tokenize #c;
addstring server.ph1tenants,#t(1);
}else{
setplayerprop #c,You already have #v(this.max) tenants!;
}
}
}
if (strequals(#t(0),RemoveTenant)){
tokenize #s(server.ph1tenants);
if(strequals(#a,#t(0))){
removestring server.ph1tenants,#t(1);
}
}
}

Can anyone see any problems? For some reason when I make someone owner and they say addtenant it says You already have 0 tenants!

It works for me and lets me add people but anyone else it wont work for online =/
Reply With Quote
  #7  
Old 01-23-2002, 04:35 AM
TDO2000 TDO2000 is offline
Registered User
TDO2000's Avatar
Join Date: Jul 2001
Location: Germany
Posts: 655
TDO2000 is on a distinguished road
NPC Code:

// NPC made by TDO
if(created){
this.max=7;
}
if(playerchats) {
tokenize #c;
if(strequals(#a,#I(server.ph1tenants,0))){
//add new Tenant
if(startswith(AddTenant,#c)){
if(sarraylen(server.ph1tenants) <= this.max){
addstring server.ph1tenants,#t(1);
}
else {
setplayerprop #c,You already have #v(sarraylen(server.ph1tenants)-1) tenants!; //-1 cause of the owner
}
}
//remove tenant
if(startswith(RemoveTenant,#c)){
removestring server.ph1tenants,#t(1);
}
}
}



I do not use so many tokenizestuff u can handle it a better way with startswith and #I
try it out
__________________
No Webhost at the moment
Reply With Quote
  #8  
Old 01-23-2002, 08:16 AM
lordhelmut lordhelmut is offline
Registered User
lordhelmut's Avatar
Join Date: Aug 2001
Posts: 710
lordhelmut is on a distinguished road
Send a message via ICQ to lordhelmut Send a message via AIM to lordhelmut Send a message via Yahoo to lordhelmut
*goes to look to see what #I does*
Reply With Quote
  #9  
Old 01-23-2002, 08:20 AM
lordhelmut lordhelmut is offline
Registered User
lordhelmut's Avatar
Join Date: Aug 2001
Posts: 710
lordhelmut is on a distinguished road
Send a message via ICQ to lordhelmut Send a message via AIM to lordhelmut Send a message via Yahoo to lordhelmut
KICK ASS!
Reply With Quote
  #10  
Old 01-23-2002, 03:18 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
lol d00d helmut, i swear, i made it...lol!
__________________

!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
  #11  
Old 01-23-2002, 09:21 PM
aesquivel aesquivel is offline
Registered User
Join Date: Sep 2001
Location: Whitewright
Posts: 346
aesquivel is on a distinguished road
Send a message via AIM to aesquivel
X.x lolz
__________________
Reply With Quote
  #12  
Old 01-23-2002, 10:49 PM
TDO2000 TDO2000 is offline
Registered User
TDO2000's Avatar
Join Date: Jul 2001
Location: Germany
Posts: 655
TDO2000 is on a distinguished road
Quote:
Originally posted by Saga2001
lol d00d helmut, i swear, i made it...lol!
um... what did u make???
__________________
No Webhost at the moment
Reply With Quote
  #13  
Old 01-24-2002, 04:23 AM
lordhelmut lordhelmut is offline
Registered User
lordhelmut's Avatar
Join Date: Aug 2001
Posts: 710
lordhelmut is on a distinguished road
Send a message via ICQ to lordhelmut Send a message via AIM to lordhelmut Send a message via Yahoo to lordhelmut
Quote:
Originally posted by TDO2000


um... what did u make???
I asked him to make a PH Script and he said he did but it took to long so I tried my hand at scripting And I just fixed my error too =D
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 04:27 PM.


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