Graal Forums

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

TheFrozenFiend 12-23-2001 01:41 AM

Question.......
 
How come on Graal 2001 in job npcs they have:

NPC Code:

if (strequals(#a,#s(this.owner))
{
commands and stuff here
}



to check if the person is the person who started doing the job.
How do they get that to work when 'this' flags can only contain numbers and peoples account names contain letters?

:confused: :confused: :confused:

Thanks

royce 12-23-2001 02:35 AM

well the this.owner doesnt affect the surrounding players because it checks for the account name. i am not sure though

mikepg 12-23-2001 02:40 AM

umm
 
when it says "this.owner" its not refering to a this.var, its refering to a string, which can be letters or numbers.


its like saying client.test=0
that can only have numbers, but
setstring client.test,hello
would work just as
setstring this.test,hello

this. infront of a string means that only that NPC can access that string.

TheFrozenFiend 12-23-2001 02:52 AM

Thx......

but if its a string then it adds it to the players list of flags and doesnt effect any other people who touch the npc so as soon as they touch it they get the same string but with their account instead so it doesnt help very much. Also if someone tries to help someone finish it instead of helping it they start their own one from the same npc but at 0% again.

*wonders if anyone understood that*

Heres a script (with some things that arent important cut out) where the things above happen:

NPC Code:

if(created)
{this.percentage=0;
setstring this.owner,#a;}

if (actionmaking && this.percentage<=99) {
maker = strtofloat(#p(0));
this.percentage+=maker;
message #v(this.percentage)%;

}


if (this.icecreampercent>=100) {
freezeplayer 0.5;
sleep 0.5;
if(strequals(#a,#s(this.owner))){
freezeplayer 0.5;
sleep 0.5;
message blah;
destroy;}
else
if(!strequals(#a,#s(this.owner)))
{
message Owner: #a(this.owner);
sleep 2;
message;
}

}



Thx :)

TDO2000 12-23-2001 02:58 AM

cause this is NPC-Server scripting (not possible offline or on Non-P2P servers) there are this-strings... these stings are saved in the NPC (The NPCs database) and everyone can acces them

zell12 12-23-2001 03:10 AM

indeed :)

TheFrozenFiend 12-23-2001 03:48 AM

Quote:

Originally posted by TDO2000
cause this is NPC-Server scripting (not possible offline or on Non-P2P servers) there are this-strings... these stings are saved in the NPC (The NPCs database) and everyone can acces them
So ive spent hours and hours trying to figure out whats wrong and its cause of the stupid npc server (or should i say lack of npc server)


aaaaaahhhhhhhhhhhhhhhhhhh :( :( :(

oh and thx :)


All times are GMT +2. The time now is 04:17 PM.

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