if(strcmp(cmd, "/exit", true) == 0) { if(IsPlayerConnected(playerid)) { for(new i = 0; i < sizeof(HouseInfo); i++) { //printf("House :%d",i); if(GetPlayerVirtualWorld(playerid) == HouseInfo[i][hWorld]) { if (PlayerToPoint(3, playerid,HouseInfo[i][hExitx], HouseInfo[i][hExity], HouseInfo[i][hExitz])) { SetPlayerVirtualWorld(playerid,0); SetPlayerInterior(playerid,0); SetPlayerPos(playerid,HouseInfo[i][hEntrancex],HouseInfo[i][hEntrancey],HouseInfo[i][hEntrancez]); PlayerInfo[playerid][pInt] = 0; PlayerInfo[playerid][pLocal] = 255; if(HouseInfo[i][hHel] == 1) { new Float:tempheal; GetPlayerHealth(playerid,tempheal); if(tempheal < 100.0) { SetPlayerHealth(playerid,100.0); } } } } } } |
if(GetPlayerVirtualWorld(playerid) == HouseInfo[i][hWorld]) |
if(strcmp(cmd, "/exit", true) == 0) { if(IsPlayerConnected(playerid)) { for(new i = 0; i < sizeof(HouseInfo); i++) { //printf("House :%d",i); if(GetPlayerVirtualWorld(playerid) == playerid+1) { if (PlayerToPoint(3, playerid,HouseInfo[hExitx], HouseInfo[hExity], HouseInfo[hExitz])) { SetPlayerVirtualWorld(playerid,0); SetPlayerInterior(playerid,0); SetPlayerPos(playerid,HouseInfo[hEntrancex],HouseInfo[hEntrancey],HouseInfo[hEntrancez]); PlayerInfo[playerid][pInt] = 0; PlayerInfo[playerid][pLocal] = 255; if(HouseInfo[hHel] == 1) { new Float:tempheal; GetPlayerHealth(playerid,tempheal); if(tempheal < 100.0) { SetPlayerHealth(playerid,100.0); } } } } } }
Originally Posted by Khelif
I mean every player will get their own virtual world. For example: PlayerID 3 => VirtualWorld = 4, PlayerID 47 => VirtualWorld = 48.
|
if(strcmp(cmd, "/exit", true) == 0)
{
if(IsPlayerConnected(playerid))
{
for(new i = 0; i < sizeof(HouseInfo); i++)
{
//printf("House :%d",i);
if(GetPlayerVirtualWorld(playerid) == HouseInfo[i][hWorld])
{
if (PlayerToPoint(3, playerid,HouseInfo[i][hExitx], HouseInfo[i][hExity], HouseInfo[i][hExitz]))
{
SetPlayerVirtualWorld(playerid,0);
SetPlayerInterior(playerid,0);
SetPlayerPos(playerid,HouseInfo[i][hEntrancex],HouseInfo[i][hEntrancey],HouseInfo[i][hEntrancez]);
PlayerInfo[playerid][pInt] = 0;
PlayerInfo[playerid][pLocal] = 255;
if(HouseInfo[i][hHel] == 1)
{
new Float:tempheal;
GetPlayerHealth(playerid,tempheal);
if(tempheal < 100.0)
{
SetPlayerHealth(playerid,100.0);
}
}
}
}
}
}
return 1;
}
if(strcmp(cmd, "/exit", true) == 0) { if(IsPlayerConnected(playerid)) { for(new i = 0; i < sizeof(HouseInfo); i++) { //printf("House :%d",i); if (PlayerToPoint(3, playerid,HouseInfo[i][hExitx], HouseInfo[i][hExity], HouseInfo[i][hExitz])) { SetPlayerInterior(playerid,0); SetPlayerPos(playerid,HouseInfo[i][hEntrancex],HouseInfo[i][hEntrancey],HouseInfo[i][hEntrancez]); PlayerInfo[playerid][pInt] = 0; PlayerInfo[playerid][pLocal] = 255; if(HouseInfo[i][hHel] == 1) { new Float:tempheal; GetPlayerHealth(playerid,tempheal); if(tempheal < 100.0) { SetPlayerHealth(playerid,100.0); } } } } for(new i = 0; i < sizeof(BizzInfo); i++) { //printf("Bizz :%d",i); if (PlayerToPoint(3, playerid,BizzInfo[i][bExitX], BizzInfo[i][bExitY], BizzInfo[i][bExitZ])) { SetPlayerInterior(playerid,0); PlayerInfo[playerid][pInt] = 0; SetPlayerPos(playerid,BizzInfo[i][bEntranceX],BizzInfo[i][bEntranceY],BizzInfo[i][bEntranceZ]); PlayerInfo[playerid][pLocal] = 255; } } if(GetPlayerVehicleID(playerid) >= 71 && GetPlayerVehicleID(playerid) <= 77) { TogglePlayerControllable(playerid, 1); RemovePlayerFromVehicle(playerid); } else if (PlayerToPoint(3.0, playerid,387.7978,173.8582,1008.382) { SetPlayerInterior(playerid,0); SetPlayerPos(playerid,1481.0356,-1771.5741,18.795; PlayerInfo[playerid][pInt] = 0; PlayerInfo[playerid][pLocal] = 255; } else if (PlayerToPoint(6.0, playerid,-1404.5299,-259.0602,1043.6563)) { SetPlayerInterior(playerid,0); SetPlayerPos(playerid,2695.6235,-1704.6960,11.843; } else if (PlayerToPoint(8.0, playerid,-1443.0554,-581.1879,1055.0472)) { SetPlayerInterior(playerid,0); SetPlayerPos(playerid,-2111.5686,-443.9720,38.7344); } else if (PlayerToPoint(8.0, playerid,-1464.7732,1557.5533,1052.5313)) { SetPlayerInterior(playerid,0); SetPlayerPos(playerid,-2080.3079,-406.0309,38.7344); } else if (PlayerToPoint(8.0, playerid,377.0454,-191.8478,1000.632) { SetPlayerInterior(playerid,0); SetPlayerPos(playerid,1038.2638,-1338.3038,13.7266); } else if(NoFuel[playerid] == 1) { TogglePlayerControllable(playerid, 1); RemovePlayerFromVehicle(playerid); NoFuel[playerid] = 0; } else if (PlayerToPoint(3.0, playerid,134.6460,1379.9669,1088.3672))//LaCosaNostra hq roof entrance { if(PlayerInfo[playerid][pMember] == 9 || PlayerInfo[playerid][pLeader] == 9) { SetPlayerInterior(playerid,0); SetPlayerPos(playerid,299.7548,-1547.5985,76.5391); } } else if (PlayerToPoint(3.0, playerid,-2159.122802,641.517517,1052.381713))//La Cosa Nostra hq exit { SetPlayerInterior(playerid,0); SetPlayerPos(playerid,2481.3496,-1536.6400,24.1253); } else if (PlayerToPoint(3.0, playerid,963.418762,2108.292480,1011.030273))//Ferrington hq exit { SetPlayerInterior(playerid,0); SetPlayerPos(playerid,2729.3279,-2451.4595,17.5937); } else if (PlayerToPoint(3.0, playerid,140.2971,1366.2645,1083.8594))//LaCosaNostra hq exit { SetPlayerInterior(playerid,0); SetPlayerPos(playerid,326.1143,-1514.0546,36.0325); } else if (PlayerToPoint(4.0, playerid,1262.6093,-785.5226,1091.9063))//Miyakazi hq interior exit { SetPlayerInterior(playerid,0); SetPlayerPos(playerid,1258.0593,-785.4180,92.0302); } else if (PlayerToPoint(4.0, playerid,1299.0443,-795.2476,1084))//Miyakazi hq interior exit 2 { SetPlayerInterior(playerid,0); SetPlayerPos(playerid,1298.4813,-798.3877,84.1406); } } return 1; } |