![]() |
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? |
uhhh
if (playerchats&&strequals(#a,#s(this.owner))&&strequ als(#c,remove 1)){ deletestring tennant1,;} something like that? |
I think that might work =D accept is it delete or removestring
|
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? |
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
|
// 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 =/ |
NPC Code: I do not use so many tokenizestuff u can handle it a better way with startswith and #I ;) try it out |
*goes to look to see what #I does*
|
KICK ASS!
|
lol d00d helmut, i swear, i made it...lol!
|
X.x lolz
|
Quote:
|
Quote:
|
| All times are GMT +2. The time now is 12:52 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.