CMD:back(playerid,params[]) { if(!IsPlayerInInterior(playerid)) return SendClientMessage(playerid, -1, "{FF0000}(INFO) You are not in lobby"); else { if(IsPlayerInInterior(playerid)) return SendClientMessage(playerid, -1, "{EFB509}(INFO) Welcome back! You can start playing now."); SpawnPlayer(playerid); SetPlayerVirtualWorld(playerid, 0); SetPlayerInterior(playerid, 0); } return 1; }
public OnPlayerSpawn(playerid) { new Random = random(sizeof(RandomSpawns)); SetPlayerPos(playerid, RandomSpawns[Random][0], RandomSpawns[Random][1],RandomSpawns[Random][2]); SetPlayerFacingAngle(playerid, RandomSpawns[Random][3]); return 1; }
new Random[MAX_PLAYERS];
public OnPlayerSpawn(playerid) { Random[playerid] = random(sizeof(RandomSpawns)); SetPlayerPos(playerid, RandomSpawns[Random[playerid]][0], RandomSpawns[Random[playerid]][1],RandomSpawns[Random[playerid]][2]); SetPlayerFacingAngle(playerid, RandomSpawns[Random[playerid]][3]); return 1; }
CMD:back(playerid,params[]) { if(!IsPlayerInInterior(playerid)) return SendClientMessage(playerid, -1, "{FF0000}(INFO) You are not in lobby"); else { if(IsPlayerInInterior(playerid)) return SendClientMessage(playerid, -1, "{EFB509}(INFO) Welcome back! You can start playing now."); SetPlayerPos(playerid, RandomSpawns[Random[playerid]][0], RandomSpawns[Random[playerid]][1],RandomSpawns[Random[playerid]][2]); SetPlayerFacingAngle(playerid, RandomSpawns[Random[playerid]][3]); SetPlayerVirtualWorld(playerid, 0); SetPlayerInterior(playerid, 0); } return 1; }
CMD:back(playerid,params[]) { new Float:IsPlayerInInterior; if(IsPlayerInInterior == 10) { SendClientMessage(playerid, -1, "{FF0000}(INFO) You are not in lobby"); } else { SendClientMessage(playerid, -1, "{EFB509}(INFO) Welcome back! You can start playing now."); SpawnPlayer(playerid); SetPlayerVirtualWorld(playerid, 0); SetPlayerInterior(playerid, 0); SetPlayerHealth(playerid,100); } return 1; }
CMD:back(playerid,params[]) { if(GetPlayerInterior(playerid) == 10) { SendClientMessage(playerid, -1, "{FF0000}(INFO) You are not in lobby"); } else { SendClientMessage(playerid, -1, "{EFB509}(INFO) Welcome back! You can start playing now."); SpawnPlayer(playerid); SetPlayerVirtualWorld(playerid, 0); SetPlayerInterior(playerid, 0); SetPlayerHealth(playerid,100); } return 1; }
CMD:back(playerid,params[]) { new interiorID = GetPlayerInterior(playerid); if (interiorID == 10) { SpawnPlayer(playerid); SendClientMessage(playerid, -1, "{EFB509}(INFO) Welcome back! You can start playing now"); SetPlayerHealth(playerid, 100); SetPlayerVirtualWorld(playerid, 0); SetPlayerInterior(playerid, 0); } else { SendClientMessage(playerid, -1, "{FF0000}(INFO) You are not in the lobby!"); } return 1; }
I used your code but in-game I just couldn't get back from lobby, Your code is more complicated to be honest.
|