15.09.2016, 16:31
Under OnPlayerSpawn
I am having problems with the code above, when I get injured, it says Welcome to your last position, which is probably detecting me as "existing player" then executing the code.
The injured isn't supposed to work that way. What's wrong with the code?
Код:
if(pInfo[playerid][PosX] == 0.0 && pInfo[playerid][PosY] == 0.0) // new player { new position = random(sizeof(CivilianSpawn)); SetPlayerPos(playerid, CivilianSpawn[position][0], CivilianSpawn[position][1], CivilianSpawn[position][2]+0.3); SetPlayerFacingAngle(playerid, CivilianSpawn[position][3]); SetPlayerInterior(playerid, 0); SetPlayerVirtualWorld(playerid, 0); SetCameraBehindPlayer(playerid); } else if(pInfo[playerid][PosX] != 0.0 && pInfo[playerid][PosY] != 0.0) // existing player { SetPlayerPos(playerid, pInfo[playerid][PosX], pInfo[playerid][PosY], pInfo[playerid][PosZ]+1.5); SetPlayerFacingAngle(playerid, pInfo[playerid][PosAngle]); SetPlayerInterior(playerid, pInfo[playerid][Interior]); SetPlayerVirtualWorld(playerid, pInfo[playerid][VirtualWorld]); SendClientMessage(playerid, COLOR_GOV, "SERVER: {FFFFFF}Welcome to your last position."); if(pInfo[playerid][SkinID] == 0) return ShowModelSelectionMenu(playerid, skinlist, "Select Skin"); } else if(IsBit(pFlag[playerid], pBIT_INJURED)) { .... } else if(IsBit(pFlag[playerid], pBIT_HOSPITALIZED)) { .... } else if(pInfo[playerid][Prison] >= 2) { .... } else if(IsBit(pFlag[playerid], pBIT_CAGED)) { .... }
The injured isn't supposed to work that way. What's wrong with the code?