pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_DRIVER)
{
for(new i; i < 200; i++)
{
new vehicleid = GetPlayerVehicleID(playerid);
if(GetVehicleModel(vehicleid) == 481 || GetVehicleModel(vehicleid) == 509 || GetVehicleModel(vehicleid) == 510)
{
new string[64];
format(string, sizeof(string), "~g~~h~Modelo:~w~ %s", GetVehicleModelName(GetVehicleModel(GetPlayerVehicleID(playerid))));
TextDrawSetString(ModeloBike[playerid], string);
TextDrawShowForPlayer(playerid, ModeloBike[playerid]);
format(string, sizeof(string), "~g~Velocidade:~w~ %d ~b~ km/h", GetPlayerSpeedVelocity(playerid));
TextDrawSetString(VeloBike[playerid], string);
TextDrawShowForPlayer(playerid, VeloBike[playerid]);
}
else
{
new string[64];
format(string, sizeof(string), "~g~Modelo:~w~ %s", GetVehicleModelName(GetVehicleModel(GetPlayerVehicleID(playerid))));
TextDrawSetString(Modelo[playerid], string);
TextDrawShowForPlayer(playerid, Modelo[playerid]);
format(string, sizeof(string), "~g~Combustivel:~w~ %d", Gasolina[playerid]);
TextDrawSetString(Posto[playerid], string);
TextDrawShowForPlayer(playerid, Posto[playerid]);
format(string, sizeof(string), "~g~Velocidade:~w~ %d~g~KM/H", GetPlayerSpeed(playerid));
TextDrawSetString(Velocidade[playerid], string);
TextDrawShowForPlayer(playerid, Velocidade[playerid]);
}
if(Gasolina[playerid] == 0)
{
if(GetVehicleModel(vehicleid) == 481 || GetVehicleModel(vehicleid) == 509 || GetVehicleModel(vehicleid) == 510)
{
TogglePlayerControllable(playerid, true);
}
else
{
TogglePlayerControllable(playerid, false);
SendClientMessage(playerid, COR_VERMELHO, "(ERRO) Vocк nгo pode dirigir um veнculo sem combustнvel!");
return 1;
}
}
if(TestIniciado[playerid] == 0)
{
if(GetVehicleModel(vehicleid) == carros[i][0])
{
if(Habilitacoes[playerid][HAB_TERRESTRE] == false)
{
if(IsPlayerAdmin(playerid)) continue;
if(GetPlayerWantedLevel(playerid) == 0){SetPlayerWantedLevel(playerid, 1);}
else if(GetPlayerWantedLevel(playerid) == 1){SetPlayerWantedLevel(playerid, 2);}
else if(GetPlayerWantedLevel(playerid) == 2){SetPlayerWantedLevel(playerid, 3);}
else if(GetPlayerWantedLevel(playerid) == 3){SetPlayerWantedLevel(playerid, 4);}
else if(GetPlayerWantedLevel(playerid) == 4){SetPlayerWantedLevel(playerid, 5);}
else if(GetPlayerWantedLevel(playerid) == 5){SetPlayerWantedLevel(playerid, 6);}
SendClientMessage(playerid, 0xC1FFC1AA, "(Info) Vocк estб dirigindo um veнculo sem carteira de motorista e foi lhe colocado uma estrela de procurado!");
return 1;
}
}
if(GetVehicleModel(vehicleid) == Airplanes[i][0])
{
if(Habilitacoes[playerid][HAB_AEREA] == false)
{
if(IsPlayerAdmin(playerid)) continue;
if(GetPlayerWantedLevel(playerid) == 0){SetPlayerWantedLevel(playerid, 1);}
else if(GetPlayerWantedLevel(playerid) == 1){SetPlayerWantedLevel(playerid, 2);}
else if(GetPlayerWantedLevel(playerid) == 2){SetPlayerWantedLevel(playerid, 3);}
else if(GetPlayerWantedLevel(playerid) == 3){SetPlayerWantedLevel(playerid, 4);}
else if(GetPlayerWantedLevel(playerid) == 4){SetPlayerWantedLevel(playerid, 5);}
else if(GetPlayerWantedLevel(playerid) == 5){SetPlayerWantedLevel(playerid, 6);}
SendClientMessage(playerid, 0xC1FFC1AA, "(Info) Vocк estб pilotando um veнculo sem habilitaзгo aerea e foi lhe colocado uma estrela de procurado!");
return 1;
}
}
if(GetVehicleModel(vehicleid) == Boats[i][0])
{
if(Habilitacoes[playerid][HAB_NAUTICA] == false)
{
if(IsPlayerAdmin(playerid)) continue;
if(GetPlayerWantedLevel(playerid) == 0){SetPlayerWantedLevel(playerid, 1);}
else if(GetPlayerWantedLevel(playerid) == 1){SetPlayerWantedLevel(playerid, 2);}
else if(GetPlayerWantedLevel(playerid) == 2){SetPlayerWantedLevel(playerid, 3);}
else if(GetPlayerWantedLevel(playerid) == 3){SetPlayerWantedLevel(playerid, 4);}
else if(GetPlayerWantedLevel(playerid) == 4){SetPlayerWantedLevel(playerid, 5);}
else if(GetPlayerWantedLevel(playerid) == 5){SetPlayerWantedLevel(playerid, 6);}
SendClientMessage(playerid, 0xC1FFC1AA, "(Info) Vocк estб pilotando um veнculo sem habilitaзгo da nautica e foi lhe colocado uma estrela de procurado!");
return 1;
}
}
return 1;
}