Jump to content
  • 0

pomoc WARNINGY


mark

Dotaz

Čaute potreboval by som pomôcť s warningami neviem ako to mam opraviť

 

warning 219: local variable "health" shadows a variable at a preceding level

 

kod:

if(strcmp(cmdtext, "/oprav", true) == 0)
{
   new Float:health,veh = GetPlayerVehicleID(playerid);
   if(Job[playerid] ==9 || Job[playerid] ==5)
{
GetVehicleHealth(veh, health);
   RepairVehicle(GetPlayerVehicleID(playerid));
   SetVehicleHealth(veh,1000);
   bodymechanik[playerid] +=1;
   GivePlayerMoney(playerid,5);
   if(health >1000) return SendClientMessage(playerid,COLOR_RED," Za opravu auta si dostal 5 $ a 1 bod. ");


}

   return 1;
}

 

a dalši taky warning

 

warning 219: local variable "health" shadows a variable at a preceding level

 

kod

 

if(strcmp(cmdtext, "/repair", true) == 0)
{
   new Float:health,veh = GetPlayerVehicleID(playerid);
if(alevel[playerid] < 1) return SCM(playerid,COLOR_RED, "Nemáš dostatočný Admin level");//pokud nema admin level 2

for(new i = 0; i < 510; i++) { RepairVehicle (i); }
{
GetVehicleHealth(veh, health);
   RepairVehicle(GetPlayerVehicleID(playerid));
   SetVehicleHealth(veh,1000);
   new string[50];

     format(string, sizeof(string) , "Administrator vám opravil vozidlo" ,PlayerName(playerid));//formatuje text správy pre odoslanie
SendClientMessageToAll(COLOR_WHITE, string);


}

   return 1;
}

Link to comment
Share on other sites

6 odpovědí na tuto otázku

Recommended Posts

  • 0

máš zle zatvorky vytvorene pred týmito príkazmi alebo už to tam maš definovane pretože v tychto prikazoch nemaš nič zle...pošli cely public OnPlayerCommandText(playerid, cmdtext[]) alebo pozri si zatvorky :d

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...