21.08.2012, 22:36
Code
Ele nao para de funfar e ainda explode
pawn Код:
forward Carro(playerid,vehicleid,health);
public Carro(playerid,vehicleid,health)
{
new Float:health;//aviso aqui
new veh;
veh = GetPlayerVehicleID(playerid);
GetVehicleHealth(veh, health);
new engine, lights, alarm, doors, bonnet, boot, objective;
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
if(health < 10)
{
if(IsPlayerInAnyVehicle(playerid))
{
TogglePlayerControllable(playerid, 0);
GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(vehicleid, 0, 0, alarm, doors, bonnet, boot, objective);
}
}
if(health > 10)
{
if(IsPlayerInAnyVehicle(playerid))
{
TogglePlayerControllable(playerid, 1);
GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(vehicleid, 1, 1, alarm, doors, bonnet, boot, objective);
}
}
}
return true;
}
pawn Код:
C:\Documents and Settings\Maurilio\Desktop\Transportando o Brasil - editado\gamemodes\TOB.pwn(1397) : warning 219: local variable "health" shadows a variable at a preceding level
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
1 Warning.