public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
new string[128];
// Entrar Casa
if(newkeys == KEY_SECONDARY_ATTACK)
{
if(!pInfo[playerid][dentrocasa])
{
new timestamp = GetTickCount();
if(timestamp - inhousepickup[playerid] > 1000)
{
return 1;
}
format(STRX, sizeof(STRX), "Casaid %d", playericonhouse[playerid]);
GetPlayerName(playerid, pInfo[playerid][Nome], 24);
if(hInfo[playericonhouse[playerid]][SemInt] == 1) return SendClientMessage(playerid, -1, "Casa sem portas");
if(strcmp(hInfo[playericonhouse[playerid]][Dono], pInfo[playerid][Nome], true) == 0)
{
playerworld[playerid] = GetPlayerVirtualWorld(playerid);
SetPlayerVirtualWorld(playerid, hInfo[playericonhouse[playerid]][Virtualworld]);
SetPlayerInterior(playerid, hInfo[playericonhouse[playerid]][Interior]);
SetPlayerPos(playerid, hInfo[playericonhouse[playerid]][InteriorX], hInfo[playericonhouse[playerid]][InteriorY], hInfo[playericonhouse[playerid]][InteriorZ]);
playerinterior[playerid] = hInfo[playericonhouse[playerid]][Interior];
pInfo[playerid][dentrocasa] = true;
format(string, sizeof(string), "Bem vindo a sua casa", hInfo[playericonhouse[playerid]][ID]);
SendClientMessage(playerid, -1, string);
return 1;
}
if(hInfo[playericonhouse[playerid]][Locked] == true) return SendClientMessage(playerid, -1, "Essa casa estб trancada");
playerworld[playerid] = GetPlayerVirtualWorld(playerid);
SetPlayerVirtualWorld(playerid, hInfo[playericonhouse[playerid]][Virtualworld]);
SetPlayerInterior(playerid, hInfo[playericonhouse[playerid]][Interior]);
SetPlayerPos(playerid, hInfo[playericonhouse[playerid]][InteriorX], hInfo[playericonhouse[playerid]][InteriorY], hInfo[playericonhouse[playerid]][InteriorZ]);
playerinterior[playerid] = hInfo[playericonhouse[playerid]][Interior];
pInfo[playerid][dentrocasa] = true;
format(string, sizeof(string), "Bem vindo б CASA ID %d", hInfo[playericonhouse[playerid]][ID]);
SendClientMessage(playerid, -1, string);
}
else
{
if(GetPlayerInterior(playerid) == playerinterior[playerid])
{
if(IsPlayerInRangeOfPoint(playerid, 2.0, hInfo[playericonhouse[playerid]][InteriorX], hInfo[playericonhouse[playerid]][InteriorY], hInfo[playericonhouse[playerid]][InteriorZ]))
{
SetPlayerPos(playerid, hInfo[playericonhouse[playerid]][iconx], hInfo[playericonhouse[playerid]][icony],hInfo[playericonhouse[playerid]][iconz]);
SetPlayerInterior(playerid, playerworld[playerid]);
SetPlayerVirtualWorld(playerid, 0);
pInfo[playerid][dentrocasa] = false;
format(string, sizeof(STRX), "Vocк saiu da casa %d.", hInfo[playericonhouse[playerid]][ID]);
SendClientMessage(playerid, -1, string);
}
else
{
SendClientMessage(playerid, -1, "Vocк estб longe da porta!");
return 1;
}
}
}
}
// Entrar Empresa
if(newkeys == KEY_SECONDARY_ATTACK)
{
if(!pInfo[playerid][dentroEmpresa])
{
new timestamp = GetTickCount();
if(timestamp - inEmpresapickup[playerid] > 1000)
{
return 1;
}
format(STRX, sizeof(STRX), "Empresa ID : %d", playericonEmpresa[playerid]);
GetPlayerName(playerid, pInfo[playerid][Nome], 24);
if(eInfo[playericonEmpresa[playerid]][eSemInt] == 1) return SendClientMessage(playerid, -1, "nгo tem portas!");
if(strcmp(eInfo[playericonEmpresa[playerid]][eDonoEmpresa], pInfo[playerid][Nome], true) == 0)
{
playerworld[playerid] = GetPlayerVirtualWorld(playerid);
SetPlayerVirtualWorld(playerid, eInfo[playericonEmpresa[playerid]][eVirtualworld]);
SetPlayerInterior(playerid, eInfo[playericonEmpresa[playerid]][eInterior]);
SetPlayerPos(playerid, eInfo[playericonEmpresa[playerid]][eInteriorX], eInfo[playericonEmpresa[playerid]][eInteriorY], eInfo[playericonEmpresa[playerid]][eInteriorZ]);
playerinterior[playerid] = eInfo[playericonEmpresa[playerid]][eInterior];
pInfo[playerid][dentroEmpresa] = true;
format(string, sizeof(string), "Sua Empresa de ID : %d ", eInfo[playericonEmpresa[playerid]][eID]);
SendClientMessage(playerid, -1, string);
return 1;
}
if(eInfo[playericonEmpresa[playerid]][eLocked] == true) return SendClientMessage(playerid, -1, "Empresa estб fechada");
playerworld[playerid] = GetPlayerVirtualWorld(playerid);
SetPlayerVirtualWorld(playerid, eInfo[playericonEmpresa[playerid]][eVirtualworld]);
SetPlayerInterior(playerid, eInfo[playericonEmpresa[playerid]][eInterior]);
SetPlayerPos(playerid, eInfo[playericonEmpresa[playerid]][eInteriorX], eInfo[playericonEmpresa[playerid]][eInteriorY], eInfo[playericonEmpresa[playerid]][eInteriorZ]);
playerinterior[playerid] = eInfo[playericonEmpresa[playerid]][eInterior];
pInfo[playerid][dentroEmpresa] = true;
format(string, sizeof(string), "Empresa ID : %d.", eInfo[playericonEmpresa[playerid]][eID]);
SendClientMessage(playerid, -1, string);
}
else
{
if(GetPlayerInterior(playerid) == playerinterior[playerid])
{
if(IsPlayerInRangeOfPoint(playerid, 2.0, eInfo[playericonEmpresa[playerid]][eInteriorX], eInfo[playericonEmpresa[playerid]][eInteriorY], eInfo[playericonEmpresa[playerid]][eInteriorZ]))
{
SetPlayerPos(playerid, eInfo[playericonEmpresa[playerid]][eiconx], eInfo[playericonEmpresa[playerid]][eicony],eInfo[playericonEmpresa[playerid]][eiconz]);
SetPlayerInterior(playerid, playerworld[playerid]);
SetPlayerVirtualWorld(playerid, 0);
pInfo[playerid][dentroEmpresa] = false;
format(string, sizeof(STRX), "saiu da Empresa ID : %d.", eInfo[playericonEmpresa[playerid]][eID]);
SendClientMessage(playerid, -1, string);
}
else
{
SendClientMessage(playerid, -1, "longe da porta!");
return 1;
}
}
}
}
return 1;
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) { new string[128]; // Entrar Casa if(newkeys & KEY_SECONDARY_ATTACK) { if(!pInfo[playerid][dentrocasa]) { new timestamp = GetTickCount(); if(timestamp - inhousepickup[playerid] > 1000) { return 1; } format(STRX, sizeof(STRX), "Casaid %d", playericonhouse[playerid]); GetPlayerName(playerid, pInfo[playerid][Nome], 24); if(hInfo[playericonhouse[playerid]][SemInt] == 1) return SendClientMessage(playerid, -1, "Casa sem portas"); if(strcmp(hInfo[playericonhouse[playerid]][Dono], pInfo[playerid][Nome], true) == 0) { playerworld[playerid] = GetPlayerVirtualWorld(playerid); SetPlayerVirtualWorld(playerid, hInfo[playericonhouse[playerid]][Virtualworld]); SetPlayerInterior(playerid, hInfo[playericonhouse[playerid]][Interior]); SetPlayerPos(playerid, hInfo[playericonhouse[playerid]][InteriorX], hInfo[playericonhouse[playerid]][InteriorY], hInfo[playericonhouse[playerid]][InteriorZ]); playerinterior[playerid] = hInfo[playericonhouse[playerid]][Interior]; pInfo[playerid][dentrocasa] = true; format(string, sizeof(string), "Bem vindo a sua casa", hInfo[playericonhouse[playerid]][ID]); SendClientMessage(playerid, -1, string); return 1; } if(hInfo[playericonhouse[playerid]][Locked] == true) return SendClientMessage(playerid, -1, "Essa casa estб trancada"); playerworld[playerid] = GetPlayerVirtualWorld(playerid); SetPlayerVirtualWorld(playerid, hInfo[playericonhouse[playerid]][Virtualworld]); SetPlayerInterior(playerid, hInfo[playericonhouse[playerid]][Interior]); SetPlayerPos(playerid, hInfo[playericonhouse[playerid]][InteriorX], hInfo[playericonhouse[playerid]][InteriorY], hInfo[playericonhouse[playerid]][InteriorZ]); playerinterior[playerid] = hInfo[playericonhouse[playerid]][Interior]; pInfo[playerid][dentrocasa] = true; format(string, sizeof(string), "Bem vindo б CASA ID %d", hInfo[playericonhouse[playerid]][ID]); SendClientMessage(playerid, -1, string); } else { if(GetPlayerInterior(playerid) == playerinterior[playerid]) { if(IsPlayerInRangeOfPoint(playerid, 2.0, hInfo[playericonhouse[playerid]][InteriorX], hInfo[playericonhouse[playerid]][InteriorY], hInfo[playericonhouse[playerid]][InteriorZ])) { SetPlayerPos(playerid, hInfo[playericonhouse[playerid]][iconx], hInfo[playericonhouse[playerid]][icony],hInfo[playericonhouse[playerid]][iconz]); SetPlayerInterior(playerid, playerworld[playerid]); SetPlayerVirtualWorld(playerid, 0); pInfo[playerid][dentrocasa] = false; format(string, sizeof(STRX), "Vocк saiu da casa %d.", hInfo[playericonhouse[playerid]][ID]); SendClientMessage(playerid, -1, string); } else { SendClientMessage(playerid, -1, "Vocк estб longe da porta!"); return 1; } } } } // Entrar Empresa if(newkeys & KEY_SECONDARY_ATTACK) { if(!pInfo[playerid][dentroEmpresa]) { new timestamp = GetTickCount(); if(timestamp - inEmpresapickup[playerid] > 1000) { return 1; } format(STRX, sizeof(STRX), "Empresa ID : %d", playericonEmpresa[playerid]); GetPlayerName(playerid, pInfo[playerid][Nome], 24); if(eInfo[playericonEmpresa[playerid]][eSemInt] == 1) return SendClientMessage(playerid, -1, "nгo tem portas!"); if(strcmp(eInfo[playericonEmpresa[playerid]][eDonoEmpresa], pInfo[playerid][Nome], true) == 0) { playerworld[playerid] = GetPlayerVirtualWorld(playerid); SetPlayerVirtualWorld(playerid, eInfo[playericonEmpresa[playerid]][eVirtualworld]); SetPlayerInterior(playerid, eInfo[playericonEmpresa[playerid]][eInterior]); SetPlayerPos(playerid, eInfo[playericonEmpresa[playerid]][eInteriorX], eInfo[playericonEmpresa[playerid]][eInteriorY], eInfo[playericonEmpresa[playerid]][eInteriorZ]); playerinterior[playerid] = eInfo[playericonEmpresa[playerid]][eInterior]; pInfo[playerid][dentroEmpresa] = true; format(string, sizeof(string), "Sua Empresa de ID : %d ", eInfo[playericonEmpresa[playerid]][eID]); SendClientMessage(playerid, -1, string); return 1; } if(eInfo[playericonEmpresa[playerid]][eLocked] == true) return SendClientMessage(playerid, -1, "Empresa estб fechada"); playerworld[playerid] = GetPlayerVirtualWorld(playerid); SetPlayerVirtualWorld(playerid, eInfo[playericonEmpresa[playerid]][eVirtualworld]); SetPlayerInterior(playerid, eInfo[playericonEmpresa[playerid]][eInterior]); SetPlayerPos(playerid, eInfo[playericonEmpresa[playerid]][eInteriorX], eInfo[playericonEmpresa[playerid]][eInteriorY], eInfo[playericonEmpresa[playerid]][eInteriorZ]); playerinterior[playerid] = eInfo[playericonEmpresa[playerid]][eInterior]; pInfo[playerid][dentroEmpresa] = true; format(string, sizeof(string), "Empresa ID : %d.", eInfo[playericonEmpresa[playerid]][eID]); SendClientMessage(playerid, -1, string); } else { if(GetPlayerInterior(playerid) == playerinterior[playerid]) { if(IsPlayerInRangeOfPoint(playerid, 2.0, eInfo[playericonEmpresa[playerid]][eInteriorX], eInfo[playericonEmpresa[playerid]][eInteriorY], eInfo[playericonEmpresa[playerid]][eInteriorZ])) { SetPlayerPos(playerid, eInfo[playericonEmpresa[playerid]][eiconx], eInfo[playericonEmpresa[playerid]][eicony],eInfo[playericonEmpresa[playerid]][eiconz]); SetPlayerInterior(playerid, playerworld[playerid]); SetPlayerVirtualWorld(playerid, 0); pInfo[playerid][dentroEmpresa] = false; format(string, sizeof(STRX), "saiu da Empresa ID : %d.", eInfo[playericonEmpresa[playerid]][eID]); SendClientMessage(playerid, -1, string); } else { SendClientMessage(playerid, -1, "longe da porta!"); return 1; } } } } return 1; }
// entrar casa
if(newkeys == KEY_SECONDARY_ATTACK)
{
// Cod
}
// entrar empresa
if(newkeys == KEY_SPRINT)
{
// Cod
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
new string[128];
if(newkeys == KEY_SECONDARY_ATTACK)
{
if(!pInfo[playerid][dentrocasa])
{
new timestamp = GetTickCount();
if(timestamp - inhousepickup[playerid] > 1000)
{
return 1;
}
format(STRX, sizeof(STRX), "Casaid %d", playericonhouse[playerid]);
GetPlayerName(playerid, pInfo[playerid][Nome], 24);
if(hInfo[playericonhouse[playerid]][SemInt] == 1) return SendClientMessage(playerid, -1, "Casa sem portas");
if(strcmp(hInfo[playericonhouse[playerid]][Dono], pInfo[playerid][Nome], true) == 0)
{
playerworld[playerid] = GetPlayerVirtualWorld(playerid);
SetPlayerVirtualWorld(playerid, hInfo[playericonhouse[playerid]][Virtualworld]);
SetPlayerInterior(playerid, hInfo[playericonhouse[playerid]][Interior]);
SetPlayerPos(playerid, hInfo[playericonhouse[playerid]][InteriorX], hInfo[playericonhouse[playerid]][InteriorY], hInfo[playericonhouse[playerid]][InteriorZ]);
playerinterior[playerid] = hInfo[playericonhouse[playerid]][Interior];
pInfo[playerid][dentrocasa] = true;
format(string, sizeof(string), "Bem vindo a sua casa", hInfo[playericonhouse[playerid]][ID]);
SendClientMessage(playerid, -1, string);
return 1;
}
if(hInfo[playericonhouse[playerid]][Locked] == true) return SendClientMessage(playerid, -1, "Essa casa estб trancada");
playerworld[playerid] = GetPlayerVirtualWorld(playerid);
SetPlayerVirtualWorld(playerid, hInfo[playericonhouse[playerid]][Virtualworld]);
SetPlayerInterior(playerid, hInfo[playericonhouse[playerid]][Interior]);
SetPlayerPos(playerid, hInfo[playericonhouse[playerid]][InteriorX], hInfo[playericonhouse[playerid]][InteriorY], hInfo[playericonhouse[playerid]][InteriorZ]);
playerinterior[playerid] = hInfo[playericonhouse[playerid]][Interior];
pInfo[playerid][dentrocasa] = true;
format(string, sizeof(string), "Bem vindo б CASA ID %d", hInfo[playericonhouse[playerid]][ID]);
SendClientMessage(playerid, -1, string);
}
else
{
if(GetPlayerInterior(playerid) == playerinterior[playerid])
{
if(IsPlayerInRangeOfPoint(playerid, 2.0, hInfo[playericonhouse[playerid]][InteriorX], hInfo[playericonhouse[playerid]][InteriorY], hInfo[playericonhouse[playerid]][InteriorZ]))
{
SetPlayerPos(playerid, hInfo[playericonhouse[playerid]][iconx], hInfo[playericonhouse[playerid]][icony],hInfo[playericonhouse[playerid]][iconz]);
SetPlayerInterior(playerid, playerworld[playerid]);
SetPlayerVirtualWorld(playerid, 0);
pInfo[playerid][dentrocasa] = false;
format(string, sizeof(STRX), "Vocк saiu da casa %d.", hInfo[playericonhouse[playerid]][ID]);
SendClientMessage(playerid, -1, string);
}
else
{
SendClientMessage(playerid, -1, "Vocк estб longe da porta!");
return 1;
}
}
}
if(!pInfo[playerid][dentroEmpresa])
{
new timestamp = GetTickCount();
if(timestamp - inEmpresapickup[playerid] > 1000)
{
return 1;
}
format(STRX, sizeof(STRX), "Empresa ID : %d", playericonEmpresa[playerid]);
GetPlayerName(playerid, pInfo[playerid][Nome], 24);
if(eInfo[playericonEmpresa[playerid]][eSemInt] == 1) return SendClientMessage(playerid, -1, "nгo tem portas!");
if(strcmp(eInfo[playericonEmpresa[playerid]][eDonoEmpresa], pInfo[playerid][Nome], true) == 0)
{
playerworld[playerid] = GetPlayerVirtualWorld(playerid);
SetPlayerVirtualWorld(playerid, eInfo[playericonEmpresa[playerid]][eVirtualworld]);
SetPlayerInterior(playerid, eInfo[playericonEmpresa[playerid]][eInterior]);
SetPlayerPos(playerid, eInfo[playericonEmpresa[playerid]][eInteriorX], eInfo[playericonEmpresa[playerid]][eInteriorY], eInfo[playericonEmpresa[playerid]][eInteriorZ]);
playerinterior[playerid] = eInfo[playericonEmpresa[playerid]][eInterior];
pInfo[playerid][dentroEmpresa] = true;
format(string, sizeof(string), "Sua Empresa de ID : %d ", eInfo[playericonEmpresa[playerid]][eID]);
SendClientMessage(playerid, -1, string);
return 1;
}
if(eInfo[playericonEmpresa[playerid]][eLocked] == true) return SendClientMessage(playerid, -1, "Empresa estб fechada");
playerworld[playerid] = GetPlayerVirtualWorld(playerid);
SetPlayerVirtualWorld(playerid, eInfo[playericonEmpresa[playerid]][eVirtualworld]);
SetPlayerInterior(playerid, eInfo[playericonEmpresa[playerid]][eInterior]);
SetPlayerPos(playerid, eInfo[playericonEmpresa[playerid]][eInteriorX], eInfo[playericonEmpresa[playerid]][eInteriorY], eInfo[playericonEmpresa[playerid]][eInteriorZ]);
playerinterior[playerid] = eInfo[playericonEmpresa[playerid]][eInterior];
pInfo[playerid][dentroEmpresa] = true;
format(string, sizeof(string), "Empresa ID : %d.", eInfo[playericonEmpresa[playerid]][eID]);
SendClientMessage(playerid, -1, string);
}
else
{
if(GetPlayerInterior(playerid) == playerinterior[playerid])
{
if(IsPlayerInRangeOfPoint(playerid, 2.0, eInfo[playericonEmpresa[playerid]][eInteriorX], eInfo[playericonEmpresa[playerid]][eInteriorY], eInfo[playericonEmpresa[playerid]][eInteriorZ]))
{
SetPlayerPos(playerid, eInfo[playericonEmpresa[playerid]][eiconx], eInfo[playericonEmpresa[playerid]][eicony],eInfo[playericonEmpresa[playerid]][eiconz]);
SetPlayerInterior(playerid, playerworld[playerid]);
SetPlayerVirtualWorld(playerid, 0);
pInfo[playerid][dentroEmpresa] = false;
format(string, sizeof(STRX), "saiu da Empresa ID : %d.", eInfo[playericonEmpresa[playerid]][eID]);
SendClientMessage(playerid, -1, string);
}
else
{
SendClientMessage(playerid, -1, "longe da porta!");
return 1;
}
}
}
}
return 1;
}
Tente agora :
PHP код:
|
new testeSet;
CMD:set(playerid)
{
testeSet = 1;
printf("testeSet : %d", testeSet);
}
// entrar casa
if(!pInfo[playerid][dentrocasa] && testeSet == 0)
// entrar empresa
if(!pInfo[playerid][dentroEmpresa] && testeSet == 1)
Nгo funciona, mas agradeзo.
Eu elaborei um teste para tentar chegar no erro, criei uma variбvel global e um comando para modificar o valor dela. PHP код:
PHP код:
|
if(playerid estб na pickup casa)
{
if(!pInfo[playerid][dentrocasa])
{
// code
}
}
if(playerid estб na pickup empresa)
{
if(!pInfo[playerid][dentroEmpresa])
{
// code
}
}
// OnPlayerKeyStateChange
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
new string[128];
if(newkeys & KEY_SECONDARY_ATTACK)
{
new timestamp = GetTickCount();
// =-=-=-=-=-=-=-=-=-=-=-= Entrar Casa =-=-=-=-=-=-=-=-=-=-=-=
if(!pInfo[playerid][dentrocasa] && timestamp - inhousepickup[playerid] < 1000)
{
SendClientMessage(playerid, -1, " CASA ");
if(timestamp - inhousepickup[playerid] > 1000)
{
return 1;
}
format(STRX, sizeof(STRX), "Casaid %d", playericonhouse[playerid]);
GetPlayerName(playerid, pInfo[playerid][Nome], 24);
if(hInfo[playericonhouse[playerid]][SemInt] == 1) return SendClientMessage(playerid, -1, "Casa sem portas");
if(strcmp(hInfo[playericonhouse[playerid]][Dono], pInfo[playerid][Nome], true) == 0)
{
playerworld[playerid] = GetPlayerVirtualWorld(playerid);
SetPlayerVirtualWorld(playerid, hInfo[playericonhouse[playerid]][Virtualworld]);
SetPlayerInterior(playerid, hInfo[playericonhouse[playerid]][Interior]);
SetPlayerPos(playerid, hInfo[playericonhouse[playerid]][InteriorX], hInfo[playericonhouse[playerid]][InteriorY], hInfo[playericonhouse[playerid]][InteriorZ]);
playerinterior[playerid] = hInfo[playericonhouse[playerid]][Interior];
pInfo[playerid][dentrocasa] = true;
format(string, sizeof(string), "Bem vindo a sua casa", hInfo[playericonhouse[playerid]][ID]);
SendClientMessage(playerid, -1, string);
return 1;
}
if(hInfo[playericonhouse[playerid]][Locked] == true) return SendClientMessage(playerid, -1, "Essa casa estб trancada");
playerworld[playerid] = GetPlayerVirtualWorld(playerid);
SetPlayerVirtualWorld(playerid, hInfo[playericonhouse[playerid]][Virtualworld]);
SetPlayerInterior(playerid, hInfo[playericonhouse[playerid]][Interior]);
SetPlayerPos(playerid, hInfo[playericonhouse[playerid]][InteriorX], hInfo[playericonhouse[playerid]][InteriorY], hInfo[playericonhouse[playerid]][InteriorZ]);
playerinterior[playerid] = hInfo[playericonhouse[playerid]][Interior];
pInfo[playerid][dentrocasa] = true;
format(string, sizeof(string), "Bem vindo б CASA ID %d", hInfo[playericonhouse[playerid]][ID]);
SendClientMessage(playerid, -1, string);
}
else
{
if(GetPlayerInterior(playerid) == playerinterior[playerid] && pInfo[playerid][dentrocasa])
{
if(IsPlayerInRangeOfPoint(playerid, 2.0, hInfo[playericonhouse[playerid]][InteriorX], hInfo[playericonhouse[playerid]][InteriorY], hInfo[playericonhouse[playerid]][InteriorZ]))
{
SetPlayerPos(playerid, hInfo[playericonhouse[playerid]][iconx], hInfo[playericonhouse[playerid]][icony],hInfo[playericonhouse[playerid]][iconz]);
SetPlayerInterior(playerid, playerworld[playerid]);
SetPlayerVirtualWorld(playerid, 0);
pInfo[playerid][dentrocasa] = false;
format(string, sizeof(STRX), "Vocк saiu da casa %d.", hInfo[playericonhouse[playerid]][ID]);
SendClientMessage(playerid, -1, string);
}
else
{
SendClientMessage(playerid, -1, "Vocк estб longe da porta!");
return 1;
}
}
}
// =-=-=-=-=-=-=-=-=-=-=-= Entrar Casa End =-=-=-=-=-=-=-=-=-=-=-=
if(!pInfo[playerid][dentroEmpresa] && timestamp - inEmpresapickup[playerid] < 1000)
{
SendClientMessage(playerid, -1, " Empresa ");
if(timestamp - inEmpresapickup[playerid] > 1000)
{
return 1;
}
format(STRX, sizeof(STRX), "Empresa ID : %d", playericonEmpresa[playerid]);
GetPlayerName(playerid, pInfo[playerid][Nome], 24);
if(eInfo[playericonEmpresa[playerid]][eSemInt] == 1) return SendClientMessage(playerid, -1, "nгo tem portas!");
if(strcmp(eInfo[playericonEmpresa[playerid]][eDonoEmpresa], pInfo[playerid][Nome], true) == 0)
{
playerworld[playerid] = GetPlayerVirtualWorld(playerid);
SetPlayerVirtualWorld(playerid, eInfo[playericonEmpresa[playerid]][eVirtualworld]);
SetPlayerInterior(playerid, eInfo[playericonEmpresa[playerid]][eInterior]);
SetPlayerPos(playerid, eInfo[playericonEmpresa[playerid]][eInteriorX], eInfo[playericonEmpresa[playerid]][eInteriorY], eInfo[playericonEmpresa[playerid]][eInteriorZ]);
playerinterior[playerid] = eInfo[playericonEmpresa[playerid]][eInterior];
pInfo[playerid][dentroEmpresa] = true;
format(string, sizeof(string), "Sua Empresa de ID : %d ", eInfo[playericonEmpresa[playerid]][eID]);
SendClientMessage(playerid, -1, string);
return 1;
}
if(eInfo[playericonEmpresa[playerid]][eLocked] == true) return SendClientMessage(playerid, -1, "Empresa estб fechada");
playerworld[playerid] = GetPlayerVirtualWorld(playerid);
SetPlayerVirtualWorld(playerid, eInfo[playericonEmpresa[playerid]][eVirtualworld]);
SetPlayerInterior(playerid, eInfo[playericonEmpresa[playerid]][eInterior]);
SetPlayerPos(playerid, eInfo[playericonEmpresa[playerid]][eInteriorX], eInfo[playericonEmpresa[playerid]][eInteriorY], eInfo[playericonEmpresa[playerid]][eInteriorZ]);
playerinterior[playerid] = eInfo[playericonEmpresa[playerid]][eInterior];
pInfo[playerid][dentroEmpresa] = true;
format(string, sizeof(string), "Empresa ID : %d.", eInfo[playericonEmpresa[playerid]][eID]);
SendClientMessage(playerid, -1, string);
}
else
{
if(GetPlayerInterior(playerid) == playerinterior[playerid] && pInfo[playerid][dentroEmpresa])
{
if(IsPlayerInRangeOfPoint(playerid, 2.0, eInfo[playericonEmpresa[playerid]][eInteriorX], eInfo[playericonEmpresa[playerid]][eInteriorY], eInfo[playericonEmpresa[playerid]][eInteriorZ]))
{
SetPlayerPos(playerid, eInfo[playericonEmpresa[playerid]][eiconx], eInfo[playericonEmpresa[playerid]][eicony],eInfo[playericonEmpresa[playerid]][eiconz]);
SetPlayerInterior(playerid, playerworld[playerid]);
SetPlayerVirtualWorld(playerid, 0);
pInfo[playerid][dentroEmpresa] = false;
format(string, sizeof(STRX), "Vocк saiu da Empresa ID : %d.", eInfo[playericonEmpresa[playerid]][eID]);
SendClientMessage(playerid, -1, string);
}
else
{
SendClientMessage(playerid, -1, "Vocк estб longe da porta");
return 1;
}
}
}
}
return 1;
}