Quote:
Originally Posted by wearLy
Vocк pode criar uma variбvel global que salva o id da casa que o player estб dessa forma:
PHP код:
new hCasaEntrou[MAX_PLAYERS];
CMD:entrarcasa(playerid)
{
for(new c; c < MAX_CASAS; c++)
{
if(IsPlayerInRangeOfPoint(playerid, 1.0, hCasaInfo[c][hEnterX], hCasaInfo[c][hEnterY], hCasaInfo[c][hEnterZ]))
{
SetPlayerInterior(playerid, hCasaInfo[c][hInt]);
SetPlayerPos(playerid, hCasaInfo[c][hSpawnX], hCasaInfo[c][hSpawnY], hCasaInfo[c][hSpawnZ]);
SetPlayerVirtualWorld(playerid, hCasaInfo[c][hVWDentro]);
hCasaEntrou[playerid] = c;
}
}
return true;
}
CMD:saircasa(playerid)
{
new idcasa = hCasaEntrou[playerid];
if (IsPlayerInRangeOfPoint(playerid, 1.0, hCasaInfo[idcasa][hExitX], hCasaInfo[idcasa][hExitY], hCasaInfo[idcasa][hExitZ]))
{
SetPlayerInterior(playerid, 0);
SetPlayerPos(playerid, hCasaInfo[idcasa][hEnterX], hCasaInfo[idcasa][hEnterY], hCasaInfo[idcasa][hEnterZ]);
SetPlayerVirtualWorld(playerid, 0);
}
return true;
}
|
Obrigado pela dica. ++rep