user.getName() == "username" doesnt work
Posted: 02 May 2017, 16:17
Hey,
i cant get what is wrong with this:
Between the dots it prints out Dex2. And Dex2 is the username i can see in the console and zone monitor.
But the if-clause never fires true?
Why?
regards
i cant get what is wrong with this:
Code: Select all
User user = (User) arg0.getParameter(SFSEventParam.USER);
trace("..........................................");
trace(user.getName());
trace("..........................................");
if(user.getName() == "Dex2"){
Vec3D newPos = new Vec3D(0, 0, 0);
SFSMMOApi mmoApi = (SFSMMOApi) SmartFoxServer.getInstance().getAPIManager().getMMOApi();
mmoApi.setUserPosition(user, newPos, getParentExtension().getParentZone().getRoomByName("City"));
trace("Gamemaster has joined!");
}
But the if-clause never fires true?
Why?
regards