Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   with(getplayer(xi)) question (https://forums.graalonline.com/forums/showthread.php?t=50764)

Jimmii 02-01-2004 09:09 AM

with(getplayer(xi)) question
 
Ok, i am rather new to... well basically the npc-server setup itself... and i have a few questions

if i am on this account, and fire an NPC that has

with(getplayer(MeoDea)) {showimg 201,block.png,playerx,playery;}

only MeoDea will be able to see the image right?
and if so, if a seperate NPC player MeoDea has calls hideimg 201, will it hide this image?

and if i do

with(getplayer(MeoDea)) {timeout=4;}

will it set a timeout for MeoDea to 4 seconds?

Sorry if these seem like simple questions, but i was told getplayer(i) makes it like player i is the active player.... but not quite... and i don't know how close it is to them being the active player

osrs 02-01-2004 03:40 PM

It's used to get informations or send informations to the specified player,serverside. E.g:

NPC Code:

with(getplayer(osrs)){
setstring client.chat,Hey osrs!;
say2 New message for you!;
}



You can send any information to osrs using 'with(getplayer())' that way.

Loriel 02-01-2004 04:55 PM

Re: with(getplayer(xi)) question
 
Quote:

Originally posted by Jimmii
with(getplayer(MeoDea)) {showimg 201,block.png,playerx,playery;}
Because with (getplayer()) is serverside, I doubt this. Also, showimgs are NPC local anyway, and only the NPC that showed an image can hide it.


Quote:

with(getplayer(MeoDea)) {timeout=4;}

Nope, timeout is NPC local and not player dependant.

Admins 02-02-2004 03:25 PM

showimg is a function of the npc, so all players would see it. Also the timeout variable belongs to the npc, so it doesn't matter who the active player is, it would always set the timeout for the npc.

If you want to change something on the clientside you will need to set strings for the player (setstring client.name,value; or setstring clientr.name,value; ) and possibly do a trigger (like triggeraction 0,0,clientside, weaponname,params; ) and on clientside you then display an image or similar when the string is set or when the trigger is received (if (actionclientside)...)

projectigi 02-05-2004 02:21 PM

Triggeraction to Clientside?
 
Hi,
Is it possible to make a triggeraction from Serverside to Clientside?

VeX_RaT_Boy 02-05-2004 03:31 PM

Re: Triggeraction to Clientside?
 
Quote:

Originally posted by projectigi
Hi,
Is it possible to make a triggeraction from Serverside to Clientside?

If it's a weapon, yes. If it's an other npc, I don't know, but i doubt it.


All times are GMT +2. The time now is 04:19 AM.

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