Graal Forums

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

excaliber7388 10-25-2005 09:56 PM

prob.
 
For some odd reason, no one but me can see this when I say something (this is for anouncing events, but no one but the speaker can see it. The weapon that triggers this is below the first script, the top one is the part that should display text, and allow warping, but it doesn't x_X This may seem repetitive, wasn't sure which parts would be better, its only at one part i think
NPC Code:
//#CLIENTSIDE
if(actionclientside){
if(strequals(#p(0),eventsmessage)){
play extra.wav;
sleep .05;
play extra.wav;
for(h=0;h<200;h++){
showtext 33433,10,430,Arial,b,#s(serverr.eventsmessage);
changeimgvis 33433,10;
timeout=.05;
if (timeout&&playerchats&&strequals(#c,/warp)){setlevel2 eventswarp_darkrival2.nw,30,35;}
sleep .05;}
hideimg 33433;
}
}


NPC Code:
if(actionserverside){
if(strequals(#p(0),call)){
setstring serverr.eventsmessage,#T(#e(8,-1,#c)) Say /warp to warp to this event!;
triggeraction 0,0,clientside,-eventsmessage,eventsmessage;
}
}
//#CLIENTSIDE
if(weaponfired){
say2 Say /message <message>#b
to send a message to all players#b
ex: /message Holding Event...Spar!#b
}
if(isweapon&&playerchats&&startswith(/message,#c)){
triggeraction 0,0,serverside,Events Team/Message,call;
triggeraction 0,0,clientside,-eventsmessage,eventsmessage;
}


ZeLpH_MyStiK 10-26-2005 01:56 AM

again, that triggeraction clientside only triggers to the current player =\

excaliber7388 10-26-2005 02:21 AM

what should be used instead?

napo_p2p 10-26-2005 02:26 AM

With the current way you have it set up, the easiest way is to have the serverside part loop through each player and trigger clientside.

A not as laggy way would be to have some kind of timeout that updates the showtext to 'serverr.eventsmessage'.

But what's up with this (in the actionclientside)?
PHP Code:

if (timeout&&playerchats&&strequals(#c,/warp)){setlevel2 eventswarp_darkrival2.nw,30,35;} 


excaliber7388 10-26-2005 03:00 AM

that was something I'm testing, so the player can warp to the event house when it comes up by saying /warp
wow, just realized how poorly thats formatted, sorry
loop through each player, like:
for(i=0;i<allplayerscount;i++)?
or something else?

napo_p2p 10-26-2005 03:55 AM

Quote:

Originally Posted by excaliber7388
loop through each player, like:
for(i=0;i<allplayerscount;i++)?

Yeah, with using 'with (allplayers[i])'.

This thread reminds me of how much GS2 is superior to GS1 :redface:.

ZeLpH_MyStiK 10-26-2005 05:25 AM

Quote:

Originally Posted by napo_p2p
Yeah, with using 'with (allplayers[i])'.

This thread reminds me of how much GS2 is superior to GS1 :redface:.

2>1 ;)
but i like gs1 =(

excaliber7388 10-26-2005 11:02 PM

hmmm, where would I put the loop with playerscount, which NPC, and what part of it?

ZeLpH_MyStiK 10-26-2005 11:38 PM

think logically, you want to trigger it to every player on the server.

excaliber7388 10-26-2005 11:56 PM

hmmmm the first one? XD i tried it there and it didn't work right, so i figured I'd ask

napo_p2p 10-27-2005 12:02 AM

*sigh*

The problem with this:
triggeraction 0,0,clientside,-eventsmessage,eventsmessage; is:
Quote:

Originally Posted by ZeLpH_MyStiK
again, that triggeraction clientside only triggers to the current player =\

Fix the problem.

excaliber7388 10-27-2005 02:23 AM

WAA i don't know what else to do, have it trigger serverside? That wouldn't work kfor some commands...unless i have it trigger serverside, then clientside? eh? maybe can't think of much else right now, if this won't work, what else would?
currently using (doesn't work at all)

NPC Code:
if(actionserverside){
if(strequals(#p(0),call)){
for(p=0;p<allplayerscount;p++){
with (getplayer(p)){
setstring serverr.eventsmessage,#T(#e(8,-1,#c)) Say /warp to warp to this event!;
triggeraction 0,0,clientside,-eventsmessage,eventsmessage;
//just trying stuff
}
}
}
}
//#CLIENTSIDE
if(weaponfired){
say2 Say /message <message>#b
to send a message to all players#b
ex: /message Holding Event...Spar!#b
}
if(isweapon&&playerchats&&startswith(/message,#c)){
triggeraction 0,0,serverside,Events Team/Message,call;
triggeraction 0,0,clientside,-eventsmessage,eventsmessage;
//again, trying stuff x_X
}


excaliber7388 10-27-2005 09:42 PM

^ ^ ^
didn't work, I cant figure this out X_X


All times are GMT +2. The time now is 11:37 AM.

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