SA-MP Forums Archive
RepairVehicle doesn't work - 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: RepairVehicle doesn't work (/showthread.php?tid=130133)



RepairVehicle doesn't work - Stas92 - 25.02.2010

Hey Guys,

I noticed, that the 0.3 function RepairVehicle doesn't work on my server.
Is there a problem in my script or with the vehicle streamer?

Код:
if(strcmp(cmd, "/fixveh", true) == 0)
	{
	  if(IsPlayerConnected(playerid))
	  {
	    
			if(PlayerInfo[playerid][pAdmin] >= 1)
			{
				if(IsPlayerInAnyVehicle(playerid))
				{
				  SetVehicleHealth(GetPlayerVehicleID(playerid), 1000.0);
				  RepairVehicle(playerid);
				}
  				return 1;
			}
		}
		return 1;
	}



Re: RepairVehicle doesn't work - Correlli - 25.02.2010

Quote:
Originally Posted by Stas92
Код:
RepairVehicle(playerid);
RepairVehicle function requires a vehicleid parameter, not playerid.


Re: RepairVehicle doesn't work - Torran - 25.02.2010

It dosent work like that,
In the future check the wiki = https://sampwiki.blast.hk/wiki/RepairVehicle

pawn Код:
if(strcmp(cmd, "/fixveh", true) == 0)
    {
      if(IsPlayerConnected(playerid))
      {
       
            if(PlayerInfo[playerid][pAdmin] >= 1)
            {
                if(IsPlayerInAnyVehicle(playerid))
                {
                  SetVehicleHealth(GetPlayerVehicleID(playerid), 1000.0);
                  RepairVehicle(GetPlayerVehicleID(playerid));
                }
                return 1;
            }
        }
        return 1;
    }



Re: RepairVehicle doesn't work - silvan - 25.02.2010

the problem is that you used " RepairVehicle(playerid); "
it soppose to be : "RepairVehicle(vehicleid);" I think

Also SetVehicleHealth is not needed before RepairVehicle, that might bug the code.


Re: RepairVehicle doesn't work - CracK - 25.02.2010

pawn Код:
if(!strcmp(cmd, "/fixveh", true))
{
  if(PlayerInfo[playerid][pAdmin] >= 1)
  {
   RepairVehicle(GetPlayerVehicleID(playerid));
   return 1;
  }
}



Re: RepairVehicle doesn't work - BlackFoX - 25.02.2010

Код:
if(!strcmp(cmd, "/fixveh", true))
{
	    
	if(PlayerInfo[playerid][pAdmin] < 1)return 1;
	if(IsPlayerInAnyVehicle(playerid))RepairVehicle(GetPlayerVehicleID(playerid));
	return 1;
}



Re: RepairVehicle doesn't work - Stas92 - 25.02.2010

You're right. I am stupid -.-