28.07.2009, 09:42
What i need to add in my /enter scirpt and /exit script to make different virtual worlds
for 3 houses in the same cordinations and the same interior
Here is my /enter script and /exit
Thanks for helping
for 3 houses in the same cordinations and the same interior
Here is my /enter script and /exit
Код:
if(strcmp(cmd, "/enter", true) == 0) { if(IsPlayerConnected(playerid)) { for(new i = 0; i < sizeof(ApartmentInfo); i++) { if (PlayerToPoint(3, playerid,ApartmentInfo[i][aEntrancex], ApartmentInfo[i][aEntrancey], ApartmentInfo[i][aEntrancez])) { //printf("Found House :%d",i); if(PlayerInfo[playerid][pPapptkey] >= 0 || ApartmentInfo[i][aLock] == 0) { SetPlayerVirtualWorld(playerid,ApartmentInfo[i][aVirtualWorld]); SetPlayerInterior(playerid,ApartmentInfo[i][aInt]); SetPlayerPos(playerid,ApartmentInfo[i][aExitx],ApartmentInfo[i][aExity],ApartmentInfo[i][aExitz]); GameTextForPlayer(playerid, "~w~Welcome Home", 5000, 1); PlayerInfo[playerid][pVirtualWorld] = ApartmentInfo[i][aVirtualWorld]; PlayerInfo[playerid][pInt] = ApartmentInfo[i][aInt]; PlayerInfo[playerid][pLocal] = i; } else { GameTextForPlayer(playerid, "~r~Locked", 5000, 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(ApartmentInfo); i++) { //printf("House :%d",i); if (PlayerToPoint(3, playerid,2365.0024,-1133.2439,1050.8750)) { SetPlayerVirtualWorld(playerid,1); SetPlayerPos(playerid,1728.8723,-1668.8131,22.6094); // SetPlayerPos(playerid,ApartmentInfo[i][aEntrancex],ApartmentInfo[i][aEntrancey],ApartmentInfo[i][aEntrancez]); SetPlayerInterior(playerid,18); PlayerInfo[playerid][pVirtualWorld] = 0; PlayerInfo[playerid][pLocal] = 255; PlayerInfo[playerid][pInt] = 0; } else if(PlayerToPoint(3, playerid, 243.7802,305.0925,999.1484)) { SetPlayerVirtualWorld(playerid,0); SetPlayerPos(playerid,2470.4888,-1402.2050,28.8333); // SetPlayerPos(playerid,ApartmentInfo[i][aEntrancex],ApartmentInfo[i][aEntrancey],ApartmentInfo[i][aEntrancez]); SetPlayerInterior(playerid,0); PlayerInfo[playerid][pVirtualWorld] = 0; PlayerInfo[playerid][pLocal] = 255; PlayerInfo[playerid][pInt] = 0; } }