PDA

View Full Version : OnPlayerConnect is bugged?!!


roleplay501
20/06/2012, 11:17 AM
Why its doesn't work onplayerconnect,

TextDrawShowForPlayer(playerid, openBlackscreen);
TextDrawShowForPlayer(playerid, openBlackscreen2);
TextDrawShowForPlayer(playerid, openRedscreen);
TextDrawShowForPlayer(playerid, openText);
TextDrawShowForPlayer(playerid, openText2);

SetPlayerPos(playerid, 2019.0272, -3302.2915, 27.0856);
SetPlayerWeather(playerid, 19);
SetPlayerTime(playerid, 20, 0);
InterpolateCameraPos(playerid,
2019.0272,
-3302.2915,
27.0856,
1870.6890,
-3251.9998,
27.8833,
30*1000, CAMERA_MOVE);

InterpolateCameraLookAt(playerid,
1982.3898,
-3277.1060,
17.5022,
1919.5918,
-3252.5857,
12.9506,
30*1000, CAMERA_MOVE);

Mimic
20/06/2012, 11:37 AM
What's the actual problem? is there an error, if so please show us the code.

roleplay501
20/06/2012, 12:23 PM
The actual problem is that its not apply the commands

SetPlayerPos
SetPlayerWeather
and SetPlayerTime

Its exist but its just like not exist (instead of seeing this i see the regular login screen (the builtin before spawning)

iggy1
20/06/2012, 12:29 PM
Players must first be spawned before you can set their position ect. You can't do it under OnPlayerConnect.

b.rock
20/06/2012, 12:31 PM
did you add TogglePlayerClock(playerid, 1); before SetPlayerTime?

Mimic
20/06/2012, 12:32 PM
I think the code is in the incorrect callback but I'm not entirely sure. Try placing the code under

public OnPlayerSpawn(playerid)

It's worth a try but I'm not 100% sure. If the code is fine, no errors and it compiles. Then I'm pretty sure it's under the incorrect callback.


Players must first be spawned before you can set their position ect. You can't do it under OnPlayerConnect.

EDIT: Yes, so I am right. That's true, the player MUST be spawned before setting anything.