04.04.2009, 17:50
Whats the "commands" for when your car reaches under 300 of health it automaticlly repairs?
Please, someone give me the code and where to put =)
Please, someone give me the code and where to put =)
SetTimerEx("AutoR", 100, true, "i"); // In OnGameModeInıt
forward AutoR(playerid);
public AutoR(playerid)
{
new Float:health;
new cid = GetPlayerVehicleID(playerid);
if (!IsPlayerInAnyVehicle(playerid))return GameTextForPlayer(playerid,"You Must In A Vehicle",1000,3);
GetVehicleHealth(cid, health);
if (health < 300)return SetVehicleHealth(cid,1000);
}
}
Originally Posted by _TeRmiNaToR_
pawn Код:
|
C:\Program\SAMP Server\gamemodes\sldm.pwn(796) : error 055: start of function body without function header C:\Program\SAMP Server\gamemodes\sldm.pwn(797) : error 010: invalid function or declaration C:\Program\SAMP Server\gamemodes\sldm.pwn(800) : error 010: invalid function or declaration
Originally Posted by _TeRmiNaToR_
pawn Код:
|
Originally Posted by _TeRmiNaToR_
I have edited and fixed the errors. :
Quote:
|
forward AutoR(playerid);
public AutoR(playerid)
{
new Float:health;
new cid = GetPlayerVehicleID(playerid);
GetVehicleHealth(cid, health);
if (!IsPlayerInAnyVehicle(playerid))return GameTextForPlayer(playerid,"You Must In A Vehicle",1000,3);
if (health < 300)return SetVehicleHealth(cid,1000);
return 1;
}
Originally Posted by _TeRmiNaToR_
pawn Код:
|