[Ajuda] OnPlayerKeyStateChange
#1

Olб, depois de um tempo afastado do pwn, estou retornando agora. Preciso de uma ajuda, nгo consigo entender o motivo do codigo a baixo nгo funcionar.

Eu consigo entrar na casa, porem nгo consigo entrar na empresa, se eu apagar a funзгo de entrar na casa, ai sim consigo entrar na empresa.

Em minha "Logica" quando aperto o botгo Enter/F estб apenas lendo a primeira funзгo. alguem pode me dizer onde estou errando nesse codigo. Agradeзo ...

PHP код:

public OnPlayerKeyStateChange(playeridnewkeysoldkeys)
{
    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(STRXsizeof(STRX), "Casaid %d"playericonhouse[playerid]);
            
GetPlayerName(playeridpInfo[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(playeridhInfo[playericonhouse[playerid]][Virtualworld]);
                
SetPlayerInterior(playeridhInfo[playericonhouse[playerid]][Interior]);
                
SetPlayerPos(playeridhInfo[playericonhouse[playerid]][InteriorX], hInfo[playericonhouse[playerid]][InteriorY], hInfo[playericonhouse[playerid]][InteriorZ]);
                
playerinterior[playerid] = hInfo[playericonhouse[playerid]][Interior];
                
pInfo[playerid][dentrocasa] = true;
                
format(stringsizeof(string), "Bem vindo a sua casa"hInfo[playericonhouse[playerid]][ID]);
                
SendClientMessage(playerid, -1string);
                return 
1;
            }
            
            if(
hInfo[playericonhouse[playerid]][Locked] == true) return SendClientMessage(playerid, -1"Essa casa estб trancada");
            
            
playerworld[playerid] = GetPlayerVirtualWorld(playerid);
            
SetPlayerVirtualWorld(playeridhInfo[playericonhouse[playerid]][Virtualworld]);
            
SetPlayerInterior(playeridhInfo[playericonhouse[playerid]][Interior]);
            
SetPlayerPos(playeridhInfo[playericonhouse[playerid]][InteriorX], hInfo[playericonhouse[playerid]][InteriorY], hInfo[playericonhouse[playerid]][InteriorZ]);
            
playerinterior[playerid] = hInfo[playericonhouse[playerid]][Interior];
            
pInfo[playerid][dentrocasa] = true;
            
format(stringsizeof(string), "Bem vindo б CASA ID %d"hInfo[playericonhouse[playerid]][ID]);
            
SendClientMessage(playerid, -1string);
        }
        else
        {
            if(
GetPlayerInterior(playerid) == playerinterior[playerid])
            {
                if(
IsPlayerInRangeOfPoint(playerid2.0hInfo[playericonhouse[playerid]][InteriorX], hInfo[playericonhouse[playerid]][InteriorY], hInfo[playericonhouse[playerid]][InteriorZ]))
                {
                    
SetPlayerPos(playeridhInfo[playericonhouse[playerid]][iconx], hInfo[playericonhouse[playerid]][icony],hInfo[playericonhouse[playerid]][iconz]);
                    
SetPlayerInterior(playeridplayerworld[playerid]);
                    
SetPlayerVirtualWorld(playerid0);
                    
pInfo[playerid][dentrocasa] = false;
                    
format(stringsizeof(STRX), "Vocк saiu da casa %d."hInfo[playericonhouse[playerid]][ID]);
                    
SendClientMessage(playerid, -1string);
                }
                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(STRXsizeof(STRX), "Empresa ID : %d"playericonEmpresa[playerid]);
            
GetPlayerName(playeridpInfo[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(playerideInfo[playericonEmpresa[playerid]][eVirtualworld]);
                
SetPlayerInterior(playerideInfo[playericonEmpresa[playerid]][eInterior]);
                
SetPlayerPos(playerideInfo[playericonEmpresa[playerid]][eInteriorX], eInfo[playericonEmpresa[playerid]][eInteriorY], eInfo[playericonEmpresa[playerid]][eInteriorZ]);
                
playerinterior[playerid] = eInfo[playericonEmpresa[playerid]][eInterior];
                
pInfo[playerid][dentroEmpresa] = true;
                
format(stringsizeof(string), "Sua Empresa de ID : %d "eInfo[playericonEmpresa[playerid]][eID]);
                
SendClientMessage(playerid, -1string);
                return 
1;
            }
            
            if(
eInfo[playericonEmpresa[playerid]][eLocked] == true) return SendClientMessage(playerid, -1"Empresa estб fechada");
            
            
playerworld[playerid] = GetPlayerVirtualWorld(playerid);
            
SetPlayerVirtualWorld(playerideInfo[playericonEmpresa[playerid]][eVirtualworld]);
            
SetPlayerInterior(playerideInfo[playericonEmpresa[playerid]][eInterior]);
            
SetPlayerPos(playerideInfo[playericonEmpresa[playerid]][eInteriorX], eInfo[playericonEmpresa[playerid]][eInteriorY], eInfo[playericonEmpresa[playerid]][eInteriorZ]);
            
playerinterior[playerid] = eInfo[playericonEmpresa[playerid]][eInterior];
            
pInfo[playerid][dentroEmpresa] = true;
            
format(stringsizeof(string), "Empresa ID : %d."eInfo[playericonEmpresa[playerid]][eID]);
            
SendClientMessage(playerid, -1string);
        }
        else
        {
            if(
GetPlayerInterior(playerid) == playerinterior[playerid])
            {
                if(
IsPlayerInRangeOfPoint(playerid2.0eInfo[playericonEmpresa[playerid]][eInteriorX], eInfo[playericonEmpresa[playerid]][eInteriorY], eInfo[playericonEmpresa[playerid]][eInteriorZ]))
                {
                    
SetPlayerPos(playerideInfo[playericonEmpresa[playerid]][eiconx], eInfo[playericonEmpresa[playerid]][eicony],eInfo[playericonEmpresa[playerid]][eiconz]);
                    
SetPlayerInterior(playeridplayerworld[playerid]);
                    
SetPlayerVirtualWorld(playerid0);
                    
pInfo[playerid][dentroEmpresa] = false;
                    
format(stringsizeof(STRX), "saiu da Empresa ID : %d."eInfo[playericonEmpresa[playerid]][eID]);
                    
SendClientMessage(playerid, -1string);
                }
                else
                {
                    
SendClientMessage(playerid, -1"longe da porta!");
                    return 
1;
                }
            }
        }
    }
        
    return 
1;

Reply


Messages In This Thread
OnPlayerKeyStateChange - by Lontresca - 08.03.2018, 23:14
Re: OnPlayerKeyStateChange - by KoloradO - 08.03.2018, 23:42
Re: OnPlayerKeyStateChange - by Lontresca - 09.03.2018, 00:04
Re: OnPlayerKeyStateChange - by FerrariL - 09.03.2018, 00:41
Re: OnPlayerKeyStateChange - by JohnBlack - 09.03.2018, 00:43
Re: OnPlayerKeyStateChange - by Lontresca - 09.03.2018, 01:18
Re: OnPlayerKeyStateChange - by JohnBlack - 09.03.2018, 01:21
Re: OnPlayerKeyStateChange - by FerrariL - 09.03.2018, 01:22
Re: OnPlayerKeyStateChange - by Lontresca - 09.03.2018, 01:37

Forum Jump:


Users browsing this thread: 1 Guest(s)