error 010: invalid function or declaration
error 010: invalid function or declaration
error 010: invalid function or declaration
public OnPlayerUpdate(playerid)
{
new Float:H;
GetPlayerHealth(playerid,H);
if(H<99 && H>1) SetPlayerHealth(playerid,10000);
return 1;
}
new Float:h;
for(new i; i<500; i++) // Erroring Line
{
if(IsPlayerConnected(i) // Erroring Line
{
h = GetVehicleHealth(GetPlayerVehicleID(i));
if(h < 1000) // Erroring Line
{
SetVehicleHealth(GetPlayerVehicleID(i),1000);
} } } }
}
public OnPlayerUpdate(playerid)
{
new Float:H;
GetPlayerHealth(playerid,H);
if(H<99)
{
SetPlayerHealth(playerid,100);
return 1;
}
if(IsPlayerConnected(playerid))
{
GetVehicleHealth(GetPlayerVehicleID(playerid), H);
if(H < 1000)
{
SetVehicleHealth(GetPlayerVehicleID(playerid),1000);
}
}
return 1;
}
new healtimer[MAX_PLAYERS];
public OnPlayerConnect(playerid)
{
healtimer[playerid] = SetTimerEx("HealTimer", 1000/* Time in milliseconds*/, 1/*repeating*/, "%d", playerid);
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
KillTimer(healtimer[playerid]);
return 1;
}
forward HealTimer(playerid);
public HealTimer(playerid);
{
if(IsPlayerConnected(playerid))
{
new Float:H;
GetPlayerHealth(playerid,H);
if(H<90) SetPlayerHealth(playerid,100);
GetVehicleHealth(GetPlayerVehicleID(playerid), H);
if(H<900) SetVehicleHealth(GetPlayerVehicleID(playerid),1000);
}
return 1;
}
PHP код:
I should notice though, this is some very bad scripting for the following reasons: 1. You use OnPlayerUpdate to fix cars and heal players, and at 99% health ![]() 2. You do a loop through all players in OPU? Why? Its already checking for all players seperate. You should read up on pawno a little more, this snippet was awfully inefficient, it would work but your server would lagg if you ever got a little more people on. |
Yes I am sorry,this is a script I made a year ago and I did not use it untill now /=
Thank you very very much anyway |
public HealTimer(playerid);
Ah I still get those 3 errors on your last script (with the timer)
Edit: fixed,by accident you did PHP код:
![]() |