![]() |
Warping players (Bug?)
I don't know if this is a bug or if I'm doing this wrong, but it worked a few weeks ago using this method and it's not working now. I'm basically trying to "summon" a player by sending my level, x and y to the serverside, then warping the player to the said co-ordinates. For some reason, if I'm on a gmap, it will warp the player far to the right of my co-ordinates.
This is the summon trigger. PHP Code:
PHP Code:
Any ideas? |
Quote:
It's because clientside player.level is the singular level, whereas serverside player.level would be the map object, while player.x and player.y is relevant to your map coordinates. You don't really need to be passing level and coordinates for a basic summon though, you could just do: PHP Code:
|
Quote:
|
I don't think you need "player.setlevel2".. Shouldn't that be "setlevel2()" since you already focused on the player?
|
Quote:
|
Quote:
|
Quote:
You don't have to use player.level in a script—you could just use level. But then it's not clear what level you're working with. The NPC's level or the player's level? It just makes it easier to understand. |
Quote:
|
Quote:
You can eliminate that possible confusion by using the appropriate prefix in your code. Also comments are supposed to help people understand what's going on in your code not help add confusion with an obscure looking comment. The only time I don't use the player prefix is with client and clientr flags. |
Quote:
|
Quote:
|
Quote:
|
Quote:
|
Quote:
|
Quote:
|
| All times are GMT +2. The time now is 01:47 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.