SA-MP Forums Archive
[Ajuda] OnPlayerStateChange Bugado - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] OnPlayerStateChange Bugado (/showthread.php?tid=259315)



[Ajuda] OnPlayerStateChange Bugado - Dr_Pawno - 04.06.2011

Gente eu percebi que o OnPlayerStateChange do meu servidor nгo esta funcionando. Ajudem ae:

pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    new vehicleid = GetPlayerVehicleID(playerid), playername[MAX_PLAYERS], string[256];
    GetPlayerName(playerid, playername, sizeof(playername));
    if(newstate == 2)
    {
        if(vehicleid == VehicleInfo[vProcurado])
        {
            SendClientMessage(playerid, COLOR_GREEN, "[INFO] {FFFFFF}Parabens! Vocк achou o veiculo procurado. Vб e entrege-o na {FF0000}garagem{FFFFFF} de {0066FF}[Las Venturas]{FFFFFF}.");
            SetPlayerCheckpoint(playerid, 1990.8500, 889.7500, 10.5555, 3);
            PlayerCheckPoint[playerid] = 3;
        }
        format(string, sizeof(string), "~g~%s", GetVehicleNameByModel(vehicleid)); GameTextForPlayer(playerid, string, 2000, 1);
        PlayerInfo[playerid][pUltimoVeiculo] = vehicleid;
        return 1;
    }
    if(oldstate == 2)
    {
        if(PlayerInfo[playerid][pUltimoVeiculo] == VehicleInfo[vProcurado])
        {
            DisablePlayerCheckpoint(playerid);
            PlayerCheckPoint[playerid] = 0;
        }
        if(VeiculoAdmin[playerid] != 9999)
        {
            DestroyVehicle(VeiculoAdmin[playerid]);
            VeiculoAdmin[playerid] = 9999;
        }
        if(VeiculoJogador[playerid] != 9999)
        {
            DestroyVehicle(VeiculoJogador[playerid]);
            VeiculoJogador[playerid] = 9999;
            VehicleDelayTimer[playerid] = SetTimerEx("VehicleDelay", VEHICLE_DELAY, false, "i", playerid);
        }
        return 1;
    }
    return 1;
}



Re: [Ajuda] OnPlayerStateChange Bugado - TheGarfield - 04.06.2011

tem como especificar ?


Re: [Ajuda] OnPlayerStateChange Bugado - Dr_Pawno - 04.06.2011

Nгo Funciona (Nгo Executa).


Re: [Ajuda] OnPlayerStateChange Bugado - TheGarfield - 04.06.2011

Quote:
Originally Posted by Dr_Pawno
Посмотреть сообщение
Nгo Funciona (Nгo Executa).
... isso eu sei!


Para oque esta public tem que fazer ?

pawn Код:
OnPlayerEnterVehicle(vehicleid)
{
if(vehicleid == VehicleInfo[vProcurado])
        {
            SendClientMessage(playerid, COLOR_GREEN, "[INFO] {FFFFFF}Parabens! Vocк achou o veiculo procurado. Vб e entrege-o na {FF0000}garagem{FFFFFF} de {0066FF}[Las Venturas]{FFFFFF}.");
            SetPlayerCheckpoint(playerid, 1990.8500, 889.7500, 10.5555, 3);
            PlayerCheckPoint[playerid] = 3;
        }
        format(string, sizeof(string), "~g~%s", GetVehicleNameByModel(vehicleid)); GameTextForPlayer(playerid, string, 2000, 1);
        PlayerInfo[playerid][pUltimoVeiculo] = vehicleid;
        return 1;
}
/\ tenta.

pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(oldstate == 2)
    {
        if(PlayerInfo[playerid][pUltimoVeiculo] == VehicleInfo[vProcurado])
        {
            DisablePlayerCheckpoint(playerid);
            PlayerCheckPoint[playerid] = 0;
        }
        if(VeiculoAdmin[playerid] != -1)
        {
            DestroyVehicle(VeiculoAdmin[playerid]);
            VeiculoAdmin[playerid] = 9999;
        }
        if(VeiculoJogador[playerid] != -1)
        {
            DestroyVehicle(VeiculoJogador[playerid]);
            VeiculoJogador[playerid] = -1;
            VehicleDelayTimer[playerid] = SetTimerEx("VehicleDelay", VEHICLE_DELAY, false, "i", playerid);
        }
    }
    return 1;
}
tente isto.

me explique:vocк й o doutor-pawno, e deveria saber tudo sobre ele ... -q


Re: [Ajuda] OnPlayerStateChange Bugado - Dr_Pawno - 04.06.2011

'-' Sei Quase! Kkkkk! Eu nгo gosto do OnPlayerEnterVehicle pq so de o kra aperta "F" ou "Enter" jб executa.

Mechi em tudo e achei o erro '-'

pawn Код:
new vehicleid = GetPlayerVehicleID(playerid), playername[MAX_PLAYERS], string[256];
pawn Код:
new playername[MAX_PLAYERS], string[256];
new vehicleid = GetPlayerVehicleID(playerid);
@Edit:
Vlw por tenta ajuda Garfield!


Re: [Ajuda] OnPlayerStateChange Bugado - TheGarfield - 04.06.2011

new playername[MAX_PLAYERS], string[256];
new vehicleid = GetPlayerVehicleID(playerid);

aconselho:

new playername[MAX_PLAYERS], string[50];
new vehicleid = GetPlayerVehicleID(playerid);


tu nem vai usar 256 de cells nisso ali.