Quote:
|
Originally Posted by excaliber7388
can't get this to work, should warp player, set attributes, and gender 
|
You've had approximately the same problem with your approach in several threads already. We've explained in great detail what the problems with your approach are. We've enumerated what is clientside and what is serverside. We've explained how to translate between the two. There is a second part to rule 1, you know.
I'll try this:
The following information is available in newfeatures2002.txt:
Quote:
- mouse variables:
mousex, mousey - position of the mouse in the level
mousebuttons - tells you which mouse buttons are pressed,
it's a sum of the values 1 for left mouse button, 2 for middle
mouse button and 4 for the right mouse button, so it's 1+2+4=7
when all buttons are pressed; you can also use the flags described
later to easier check for the mouse buttons
mousescreenx, mousescreeny - position of the mouse in the game screen
mousewheeldelta - the movement of the mouse wheel in the last 0.05 seconds
- flags for checking if a mouse button is pressed:
leftmousebutton - is set when the left mouse button is down
middlemousebutton - is set when the middle mouse button is down
rightmousebutton - is set when the right mouse button is down
- events:
mousedown - occurs when a mouse button has been pressed, so
you can do things like if (mousedown && leftmousebutton) message hi;
mouseup - occurs when a mouse button has been released
mousewheel - occurs when the mouse wheel has been used
- triggered actions (only on npcs where the player has clicked on,
is also sent to the npcserver):
actionleftmouse - the player has clicked on the npc
actionmiddlemouse - the player has clicked with the middle mouse button on the npc
actionrightmouse - the player has right-clicked on the npc
actiondoublemouse - the player has double-clicked on the npc
|
The following is the correct format of weapon triggeractions:
NPC Code:
triggeraction 0,0,serverside,weaponname,params;
What do you suppose the problem(s) with your approach could be? I'll make this easier by bolding the parts you ought to look at:
NPC Code:
// Graal2002 NPC by Excaliber
if(actionserverside){
...
}
if (mousedown && ...){
...
}
//#CLIENTSIDE
if (mousedown && ...){
...
triggeraction playerx,playery,serverside,warp;
}
if (created) {
...
}
What do you suppose is wrong with that?
Other than that, I do have a suggestion: you should definitely consider placing a lot of those conditional checks within the event block you have associated them with. It might help you understand what's going on with your script better.