SA-MP Forums Archive
help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: help (/showthread.php?tid=98026)



help - MB@ - 18.09.2009

Код:
forward AutoR();

public OnFilterScriptInit()

SetTimer("AutoR", 1000, 1);

      
      public AutoR() {
  	for(new playerid=0; playerid<MAX_PLAYERS; playerid++) {
      if(IsPlayerConnected(playerid)) {
     (279)==> new Float:health, cid;
      if (IsPlayerInAnyVehicle(playerid)) {
      cid = GetPlayerVehicleID(playerid);
      GetVehicleHealth(cid, health);
      if (health < 300) {
      SetVehicleHealth(cid,1000);
      GameTextForPlayer(playerid, "Vehicle repaired!",2000,5);
      }
      }
      }
    	}
    	return 1;
			}

Код:
C:\Documents and Settings\Administrator\Desktop\Samp-server\gamemodes\Stunt-World.pwn(279) : warning 219: local variable "health" shadows a variable at a preceding level
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Warning.
Please help


Re: help - Kyle - 18.09.2009

Change

new Float:health, cid;

to

new cid;