[Ajuda] OnPlayerStateChange Bugado
#1

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;
}
Reply
#2

tem como especificar ?
Reply
#3

Nгo Funciona (Nгo Executa).
Reply
#4

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
Reply
#5

'-' 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!
Reply
#6

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)