04.06.2011, 03:48
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;
}