Ok, so I've got this weird bug going, client-side. I've been trying to fix it myself, but nothing seems to do it.
addEventHandler ( "openCharacterGUI", client, function ()
showCursor ( true )
guiSetVisible ( charWindow[1], true )
triggerServerEvent ( "getChars", client )
charPed = createPed ( 34, 0, 0, 0 )
setElementFrozen ( charPed, true )
setElementPosition ( charPed, 1254.7118, -1439.0953, 333.8233 )
setElementDimension ( charPed, 0 )
setElementInterior ( charPed, 0 )
setPedAnimation ( charPed, "ped", "IDLE_stance", -1 )
setElementRotation ( charPed, 0, 0, 0 )
setTimer ( function ()
localCharSkin = tonumber ( getElementModel ( charPed ) )
x,y,z = getElementPosition ( charPed )
setTimer ( function ()
outputChatBox ( "PedLoc: "..x..", "..y..", "..z )
end, 200, 10 )
if ( charPed ) then
outputChatBox ( "char = true, "..tostring(charPed).." "..tostring(localCharSkin).." "..getElementInterior ( charPed).." "..getElementDimension(charPed).." "..getElementAlpha ( charPed ) )
else
outputChatBox ( "char = false" )
end
end, 100, 1 )
end )
Before you ask, yes, the "openCharacterGUI" event IS triggered, because the GUI does appear, and so does the cursor. The only thing that does not appear is the Ped.
As you guys probably noticed, I've put in some debug messages to find out just what's wrong. And that's the point, nothing is wrong. According to the debug messages, which go:
char = true, userdata: 000201E2 34 0 0 255
PedLoc: 1254.7117919922, -1439.0953369141, 333.82330322266
PedLoc: 1254.7117919922, -1439.0953369141, 333.82330322266
PedLoc: 1254.7117919922, -1439.0953369141, 333.82330322266
PedLoc: 1254.7117919922, -1439.0953369141, 333.82330322266
PedLoc: 1254.7117919922, -1439.0953369141, 333.82330322266
PedLoc: 1254.7117919922, -1439.0953369141, 333.82330322266
PedLoc: 1254.7117919922, -1439.0953369141, 333.82330322266
PedLoc: 1254.7117919922, -1439.0953369141, 333.82330322266
PedLoc: 1254.7117919922, -1439.0953369141, 333.82330322266
PedLoc: 1254.7117919922, -1439.0953369141, 333.82330322266
It's saying that yes, the ped exists. It's skin is 34, dimension is 0, interior is 0, it's Alpha is 255 and the location does not change at all. And yet, I see not ped. I've even taken a jetpack to the location the ped is suppose to be at, and it's not there. I've checked the central map coordinates, it wasn't there either. Finally, I decided that this script was basically turning into a "Where's Wally" game and came here for advice...
Also, note, this IS part of a larger client-side script, but I have no reason to suspect anything else in there would be causing this.