Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Server (https://forums.graalonline.com/forums/forumdisplay.php?f=14)
-   -   CLIENTSIDE Question (https://forums.graalonline.com/forums/showthread.php?t=25012)

cell424 03-04-2002 02:00 AM

CLIENTSIDE Question
 
I was wondering if //#CLIENTSIDE had to be in every NPC you script with the client, or jsut in the NPCs that have NPC Server Functions in it?

Python523 03-04-2002 02:33 AM

Its for every npc that you don't want to NPC Server to control

happyme 03-04-2002 07:53 AM

oh
 
oh ive been thinking the opposite x.X

cell424 03-05-2002 04:24 AM

kkk
 
K Thanks alot, does toweapons work in a P2P Server also or do you have to use addweapon?

Python523 03-05-2002 04:35 AM

Re: kkk
 
Quote:

Originally posted by cell424
K Thanks alot, does toweapons work in a P2P Server also or do you have to use addweapon?
toweapons works clientsided, addweapon works serversided, also dont do any serversided scripts inside of weapons since they are clientsided

Cybnext_Design 03-05-2002 10:52 AM

Re: Re: kkk
 
Quote:

Originally posted by Python523

toweapons works clientsided, addweapon works serversided, also dont do any serversided scripts inside of weapons since they are clientsided

This is pretty much completely incorrect. toweapons causes the weapon to be added to the weapon database. You can put serverside scripts in weapons, but you have to do it a weird way:

serverside part of the weapon:
NPC Code:

if (actionserverside) {
setlevel2 leveltest.graal,30,30;
}



Clientside part of the weapon:
NPC Code:

triggeraction 0,0,serverside,God Ring,warpplayer,#v(this.cursor),;


cell424 03-05-2002 06:03 PM

k Thanks alot, so if I got this all right I guess when you first put a NPC up you use toweapons, go to the item and touch it so it adds itself to the database, then change it to addweapon for everyone else. k I think I got it. Here is one of my scripts, would this work?

NPC Code:

// NPC made by Trunks (Owner)
//#CLIENTSIDE
if (playerenters) {
toweapons *System;
}

if (isweapon) {
//Map Systems
if (!startswith(sidi_miningcaves,#L)) {
setmap sidimap.png,sidimap.txt,x,y;
}
}
//Shoe System
if (isweapon) {
if (!madeshoes && !strequals(#C3,orange)) {
setplayerprop #C3, orange;
}
else
timeout=0;
setplayerprop #C3, #C3;

if (!madeshoes && isonmap) {
timeout=10;
}

if (timeout && isonmap) {
hurt 1;
timeout=10;
say2 You really should make yourself#ba pair of shoes before you really#bhurt yourself..
}
}



NPC Code:

//#CLIENTSIDE
if (playerenters) {
toweapons Bow;
hide;
}
if (weaponfired && playerdarts>0) {
freezeplayer 0.3;
setani shoot,wbow1.gif;
timeout=0.25;
}

if (timeout && !fireonhorse) {
shootarrow playerdir;
playerdarts = playerdarts-1;
}



NPC Code:

//#CLIENTSIDE
if (playerenters) {
toweapons Bomb;
hide;
}
if (weaponfired && playerbombs>0) {
if (playerdir=0) {
putbomb 1,playerx+0.5,playery-1;
}
if (playerdir=1) {
putbomb 1,playerx-1.5,playery+1;
}
if (playerdir=2) {
putbomb 1,playerx+0.5,playery+2.5;
}
if (playerdir=3) {
putbomb 1,playerx+2.5,playery+1;
}
playerbombs=playerbombs-1;
}




Would they work online in a P2P Server?

joseyisleet 03-05-2002 07:19 PM

-=Josey=-
I do believe all of that would've worked with the //#CLIENTSIDE in them.

Admins 03-05-2002 08:27 PM

toweapons/addweapon must be called on the server-side,
otherwise you are disconnected (hacker activity)

screen_name 03-05-2002 08:42 PM

Quote:

Originally posted by Stefan
toweapons/addweapon must be called on the server-side,
otherwise you are disconnected (hacker activity)

:P, cool beans

Saga2001 03-06-2002 12:14 AM

I got cha, thats smart. ;). Well it makes sence at least.

cell424 03-06-2002 03:42 AM

k
 
So then, it doesnt really matter which one I use. Ok thanks alot Stefan for making it clear for me.

SaijinGohan 03-06-2002 10:10 AM

Both should be used server-side as stefan said, toweapons you use when you want the script to come from the NPC itself, addweapon you only use if the weapon in the weapons database already.

cell424 03-06-2002 06:01 PM

Thanks alot guys, ever since I quit working on Manatra2001 and became a free lance level designer and scripter I've been learning alot!


All times are GMT +2. The time now is 07:43 AM.

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