![]() |
Clientr.PROBLEM
I'm trying to figure out how to script it so that when a player logs on for the first time on my server (or thier account is reset) their clientr script flag will be: clientr.mud_nation= Neutral
I am a newb scripter and have no idea how to do this, so please be as specific as possible. ^_^ Thanks |
PHP Code:
|
PHP Code:
If that doesn't work then I think it's because of "function onPlayerEnters()" but I believe it should work. |
Quote:
2) Talon, if you want to use that, you'd need to add it into your NPC-Control. |
Uhm...if your NPC server doesn't have an onActionPlayerOnline() function already, all you need to do is
PHP Code:
|
We can't use !clientr.var as a condition?
|
Quote:
|
Need me to log on and help ya?
|
Quote:
|
I thought clientr.mud_<varname> was reserved?
|
Quote:
|
Quote:
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. |
You don't have to put it in the Control-NPC (You can use onPlayerLogin from any WNPC) but if you use WNPCs, just know that the player doesn't have to have the npc for the function to be called. It's very annoying when there something being done to the player when he logs in and you can't find the reason in the control-npc.
|
I'd take what zero said an leave.
|
Quote:
|
Quote:
|
HTML Code:
(clientr.mud_nation == null? "Neutral":clientr.mud_nation); |
Quote:
|
PHP Code:
PHP Code:
|
Quote:
PHP Code:
So in this case, xAndrewx's expression is pretty much the equivalent to: PHP Code:
EDIT: Ziro beat me to it, but hopefully now you get the point :P. |
Quote:
|
Quote:
Seriously though, when I pushed reply your post appeared. I wouldn't have replied if I knew you had already :(. |
Quote:
|
it's an operator. beats an if statement for the same result.
|
I tried to put in that script that coreys suggested:
PHP Code:
|
Quote:
PHP Code:
|
A more simple way to put it:
foo = bool ? a : b; If bool is true, foo would be assigned a. If bool is false, foo would be assigned b. You just then put a condition statement in place of the bool such as: foo = (a < b) ? a : b; Because condition statements are bools ;) |
Quote:
|
Thanks everyone. I got it to work ^_^
Now I have a new problem, but its doesn't have to do with the clientr. flags or w/e. I'm trying to script something so that when this weapons is added to someone, it will also add a bunch of other weapons to the player. For instance, if I add the weapon "-StaffPackage" to the account "Wookieman", then it will also add the weapons "-Jump", "-Staffcontrol" and "Staff/Adder" to "Wookieman". Can anyone help me out here? |
PHP Code:
|
Quote:
PHP Code:
|
better yet
HTML Code:
function onCreated() { |
Since when can you use player in onCreated serverside (outside a with block)? Come on guys...
|
Quote:
|
Remember now, I am stupid at scripts so if you could tell me exactly where to write the weapon names and where to put the script. Please try to be as specific as possible. Thanks ^_^
|
Quote:
|
Quote:
With weapon scripts and Database NPCs, the serverside onCreated() is called on NPC-Server startup or script update. With player classes, the serverside onCreated() is called when the player logs on (although presumably it is more when the class is joined to the player or something). |
Quote:
|
I use onCreated() serverside and have yet to experience a major problem. o.O
|
Quote:
PHP Code:
|
| All times are GMT +2. The time now is 03:37 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.