[AJUDA]Problemas no OnPlayerKeyStateChange
#2

Tente.
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if(newkeys == KEY_SECONDARY_ATTACK)
    {
        for(new i = 0; i < sizeof(TotalEmpresas); ++i)
        {
            if(IsPlayerInRangeOfPoint(playerid, 3, BusinessInfo[i][SaidaX], BusinessInfo[i][SaidaY], BusinessInfo[i][SaidaZ]))
            if(BusinessInfo[i][Interior] == 0) return SendClientMessage(playerid, -1, "Empresa desativada temporбriamente.");
            {
                if(BusinessInfo[i][Chave] == 0)
                {
                    SetPlayerInterior(playerid, BusinessInfo[i][Interior]);
                    SetPlayerVirtualWorld(playerid, BusinessInfo[i][VirtualWorld]);
                    SetPlayerPos(playerid, BusinessInfo[i][EntradaX], BusinessInfo[i][EntradaY], BusinessInfo[i][EntradaZ]);
                }
                else { GameTextForPlayer(playerid, "EMPRESA FECHADA", 3000, 1); }
            }
            if(IsPlayerInRangeOfPoint(playerid, 3, BusinessInfo[i][EntradaX], BusinessInfo[i][EntradaY], BusinessInfo[i][EntradaZ]))
            {
                if(GetPlayerVirtualWorld(playerid) == BusinessInfo[i][VirtualWorld])
                {
                    SetPlayerInterior(playerid, 0);
                    SetPlayerVirtualWorld(playerid, 0);
                    SetPlayerPos(playerid, BusinessInfo[i][SaidaX], BusinessInfo[i][SaidaY], BusinessInfo[i][SaidaZ]);
                }
            }
        }
        for(new i = 0; i < sizeof(TotalCasas); ++i)
        {
            if(IsPlayerInRangeOfPoint(playerid, 3, HouseInfo[i][SaidaX], HouseInfo[i][SaidaY], HouseInfo[i][SaidaZ]))
            {
                if(HouseInfo[i][Chave] == 0)
                {
                    SetPlayerInterior(playerid, HouseInfo[i][Interior]);
                    SetPlayerVirtualWorld(playerid, HouseInfo[i][VirtualWorld]);
                    SetPlayerPos(playerid, HouseInfo[i][EntradaX], HouseInfo[i][EntradaY], HouseInfo[i][EntradaZ]);
                }
                else { GameTextForPlayer(playerid, "CASA FECHADA", 3000, 1); }
            }
            if(IsPlayerInRangeOfPoint(playerid, 3, HouseInfo[i][EntradaX], HouseInfo[i][EntradaY], HouseInfo[i][EntradaZ]))
            {
                if(GetPlayerVirtualWorld(playerid) == HouseInfo[i][VirtualWorld])
                {
                    SetPlayerInterior(playerid, 0);
                    SetPlayerVirtualWorld(playerid, 0);
                    SetPlayerPos(playerid, HouseInfo[i][SaidaX], HouseInfo[i][SaidaY], HouseInfo[i][SaidaZ]);
                }
            }
        }
    }
    return 1;
}
Reply


Messages In This Thread
[AJUDA]Problemas no OnPlayerKeyStateChange - by [Y]ellow - 14.02.2012, 11:13
Re: [AJUDA]Problemas no OnPlayerKeyStateChange - by paulor - 14.02.2012, 14:26
Re: [AJUDA]Problemas no OnPlayerKeyStateChange - by [Y]ellow - 14.02.2012, 14:37
Re: [AJUDA]Problemas no OnPlayerKeyStateChange - by paulor - 14.02.2012, 15:04

Forum Jump:


Users browsing this thread: 1 Guest(s)