Quote:
Originally Posted by Switch
PHP Code:
function onActionServerSide() {
with (findplayer(params[0])) {
clientr.mud_nation = "Neutral";
}
}
//#CLIENTSIDE
function onPlayerEnters() {
if (clientr.mud_nation == NULL) {
triggerserver("gui",this.name,player.account);
}
}
|
Although your method works perfectly fine, that way isn't the best way to go about doing this.
There are a few problems I see right off the bat:
1) For this sort of situation, it is better to use the Control-NPC.
2) That way you have it set up isn't totally secure. (People could potentially reset the nation of other players). You do not need to pass player.account and have it find the player again serverside.
3) You only have to check for the condition when the weapon is created, and not every time a player enters a level.