Quote:
Originally posted by GrowlZ1010
If you have a normal non-weapon NPC, how does IT trigger p2p events? I know that weapons use "triggeraction serverside,0,0,#w", but I have no idea how to make non-weapon NPCs use serverside features. Could I use a function, as in:
NPC Code:
//#SERVERSIDE
function addmeaweapon(){
addweapon Trading Item;
}
//#CLIENTSIDE
if (playertouchsme){
addmeaweapon();
}
... or would something else be necessary? I tried using triggeraction serverside, but it didn't do anything, so I tried removing the addweapon command and used setplayerprop #c,Trading Item!; as a test, but that didn't work either.. what would I need to do?
|
To trigger an action from the client side part of the script, to the server side part of the script, you first have to make the event to be triggered that starts with actionserver (ex: if(actionserverfoggy)). Then to make the thing be triggered, use "triggeraction x,y,serverfoggy,;". =)
It would be somethin liek this
NPC Code:
if(actionserverfoggy) {
addweapon Trading;
}
//#CLIENTSIDE
if(playertouchsme) {
triggeraction 0,0,serverfoggy,;
}
But if I were you, i would just do this:
NPC Code:
if(playerenters) {
setshape 1,32,32;
}
if(playertouchsme) {
addweapon Trading;
}
Instead of doing the triggeraction =P