30.03.2011, 13:07
hey i am trying to make a auto repair system for my server but it does not work here is what i have done
public OnGameModeInit()
i get 0 errors but in game it does not work
pawn Code:
new autorepair[MAX_PLAYERS];
forward OnVehicleDamage(playerid);
public OnVehicleDamage(playerid)
{
new Float:health, cid;
if(autorepair[playerid] == 1)
{
if (!IsPlayerInAnyVehicle(playerid))
{
cid = GetPlayerVehicleID(playerid);
GetVehicleHealth(cid, health);
{
if (health < 500)
{
SetVehicleHealth(cid, 1000);
}
}
}
}
return 1;
}
pawn Code:
SetTimer("OnVehicleDamage", 1000, 1);
pawn Code:
if (strcmp("/racemap", cmdtext, true, 10) == 0)
{
SetPlayerPos(playerid, 5070.8862304688, -2250.9711914063, 403.73211669922+1);
SendClientMessage(playerid, COLOR_ORANGE, " Thank Speederx for making the race/stunt map");
autorepair[playerid] = 1;
return 1;
}