Quote:
Originally posted by Idrox0
I just want info on client/serverside, because I STILL don't get it. So, I want a VERY good scripter(like Kai) to change this example script to one that would work on an NPC server.
NPC Code:
if (playertouchsme) {
toweapons 4-Way Bow;
hide;
}
if (weaponfired) {
if (playerdarts=>4) {
shootarrow 0;
shootarrow 1;
shootarrow 2;
shootarrow 3;
playerdarts-=4;
}
}
I apologize for the relatively long script, I'm just making as simple as possible, not that you can't handle it, though.
|
For online play you will need to put a NPC into a level with addweapon instead of toweapons and it must be serverside.
Everything under //#CLIENTSIDE is clientside and everything above it is serverside.
example:
NPC Code:
if(playertouchsme)
addweapon your weapon;
--
Your weapon script will go into the weapons database and will have to be clientside.
NPC Code:
//#CLIENTSIDE
if(weaponfired && playerdarts >= 4){
for(i = 0; i < 4; i ++)
shootarrow i;
triggeraction 0,0,serverdarts,sub,4; // *1 (refer to notes below)
}
/* *\
Notes:
1. triggers an action to the control.
Inside the control there will be a section that will say
if(actionserverdarts){
if(strequals(#p(0),sub))
playerdarts -= strtofloat(#p(1));
}
}
You will have to modify your script to work.
There are other ways to subtract arrows other than the example I provided. What you may need is that old npcserver.doc
Search the forums and you should be able to find it.