Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Ownership (https://forums.graalonline.com/forums/showthread.php?t=14528)

bdh 10-13-2001 04:33 PM

Ownership
 
how do i script something so that you can own it

KJS 10-13-2001 07:15 PM

Re: Ownership
 
Quote:

Originally posted by bdh
how do i script something so that you can own it
like trees on 2001 or bomys?

well they go something like

setstring this.owner,#a;

but see it wouldn't work right on a free server

grim_squeaker_x 10-13-2001 07:27 PM

if (created) message You own me!;

toad1413 10-13-2001 07:55 PM

Quote:

Originally posted by grim_squeaker_x
if (created) message You own me!;
if (ownsGrim) {
message I know!;
}

ownerofbabylon 10-13-2001 09:36 PM

Re: Re: Ownership
 
Quote:

Originally posted by KJS


like trees on 2001 or bomys?

well they go something like

setstring this.owner,#a;

but see it wouldn't work right on a free server

so you couldnt have ownership on a free serv?

nyghtGT 10-13-2001 11:36 PM

Re: Re: Re: Ownership
 
Quote:

Originally posted by ownerofbabylon


so you couldnt have ownership on a free serv?

yes you could it would just work weird ...

KJS 10-14-2001 12:40 AM

Re: Re: Re: Ownership
 
Quote:

Originally posted by ownerofbabylon


so you couldnt have ownership on a free serv?

u can but it would be more complex of a code...

Enigma_GP6 10-14-2001 02:09 AM

I kn0ow, I is making a free server, and the stupid code is like a mile long to get it to work right, it goes like this,:

if (playerchats&&strcontains(#c,Buy House 1)&&playerrupees<150){}
if (playerchats&&strcontains(#c,Buy House 1)&&playerrupees>149){
setstring server.hse1n,#a;
playerrupees-=150;
}
//Door Script
if (playerenters||timeout){
message This house is owned by #v(#s,server.hse1n);
timeout=0.05;
}
//and then you have to add all the stuff about selling, but
// where it is still free. You can't do much with individual strings,
// and I use it as a server string, because I have a list on
// onlinestartlocal that says who owns what. So you don't
// have to go to each house to see who owns them. Regular
// strings tend to only work for one player.

-Rebel95

btedji 10-14-2001 08:19 AM

ahhhhhhh

you dont need #v for strings!!!

and you dont use this. for strings!!!

dragoonvenganc 10-14-2001 10:47 AM

Lets all hope he is not a nat on his server..

dragoonvenganc 10-14-2001 10:49 AM

and another thing its not a mile long man. people..

its just setstring server.houseowner1,#a;

that makes it = but its not the hole script you just need the server. to make it so other players can see who owns it to.

kammy is comming though soon and going to correct me brace yourselves.

WeirdmanI9 10-14-2001 11:42 AM

How about just having different flags to assign to a certain player for a certain thing to own, and then set the NPC's mode to something else so no one else can get the owner flag?

That'll work on a free server.

nyghtGT 10-14-2001 11:46 AM

Quote:

Originally posted by WeirdmanI9
How about just having different flags to assign to a certain player for a certain thing to own, and then set the NPC's mode to something else so no one else can get the owner flag?

That'll work on a free server.

flags are not very good for scripting they have very little use most of the time .......

ownerofbabylon 10-14-2001 01:06 PM

how would u make a npc lose ownership but retain percent value if no one hits it for so long an amount of time?

btedji 10-15-2001 12:22 AM

Quote:

Originally posted by ownerofbabylon
how would u make a npc lose ownership but retain percent value if no one hits it for so long an amount of time?
what would this "value" you retain be for?

ownerofbabylon 10-15-2001 12:49 AM

so that the item stays there and is still 78% done or whatever but if no one hits it for say 20 seconds there is no owner and the next person to hit it becomes owner and continues on from 78%

btedji 10-15-2001 01:31 AM

start a 20 second timeout everything the player has hit and if that timeout finishes then disable the owner

Brandon_Bravo 10-15-2001 08:37 AM

House Script for Free Servers
 
PURCHASING SCRIPT:
NPC Code:
// NPC made by Brandon_Bravo
if (playerchats) {
if (strequals(#c,purchase hs1)) {
if (playerrupees>1999) {
playerrupees-=2000;
setstring server.hs1owner,#a;
}
}
}


DOOR SCRIPT:
NPC Code:
// NPC made by Brandon_Bravo
if (playertouchsme) {
if (strcontains(server.hs1keys,#a_)) || strequals(#s(server.hs1owner),#a)) {
hide;
sleep 3;
show;
}
else {
message Sorry you need a key, this is the house from #s(server.hs1owner)!;
}
}


KEY SCRIPT:
NPC Code:
// NPC made by Brandon_Bravo
if (playerchats) {
if (startswith(givekey,#c)) {
if (strequals(#s(server.hs1owner),#a)) {
tokenize #c;
setstring this.givekey,#t(1);
setstring server.hs1keys,#s(server.hs1keys) "#s(this.givekey);
}
}
}



UPDATE: SCRIPT TO TAKE KEYS AWAY:
NPC Code:
// NPC made by Brandon_Bravo
if (playerchats) {
if (startswith(removekey,#c)) {
tokenize #c;
setstring this.exclude,#t(1);
tokenize #s(server.hs1keys);
setstring server.hs1keys,;
for (i=0;i<tokenscount-1;i++) {
if (!strequals(#t(i),#s(this.exclude))) {
setstring server.hs1keys,#s(server.hs1keys) "#t(i)";
}
}
}
}


dragoonvenganc 10-15-2001 09:49 AM

hey brandon is that not what i said i just dint add the hole thing.. and to get it to retain.. percent.. just do

setstring server.rock1percent,whatever;
and then just do a timeout thing for how ever long and just keep incrementing the server.rock1percent.. then change ownership..

Brandon_Bravo 10-15-2001 10:13 AM

I know, it just made sense to post the whole thing :-P

BocoC 10-15-2001 10:30 AM

Make a timeout. After the timeout has been reached, set the owner to no owner. But, if you activate the npc with a triggeraction or something, reset the timeout.

btedji 10-15-2001 07:22 PM

Quote:

Originally posted by BocoC
Make a timeout. After the timeout has been reached, set the owner to no owner. But, if you activate the npc with a triggeraction or something, reset the timeout.
did you see my last post??

bdh 10-16-2001 05:13 PM

1 Attachment(s)
hey i have the G2K1 house script but i want it for non p2p


All times are GMT +2. The time now is 03:51 PM.

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