20.04.2013, 01:23
Yup, you have to use GetPlayerPos().
You can try defining the old positions as a global variable.
Then create a timer that checks if OldPos[0], OldPos[1] and OldPos[2] are equal to the players current positon. (Which you get with GetPlayerPos()
You can try defining the old positions as a global variable.
Code:
new Float:OldPos[3]; //under defines
CMD:fix(playerid,params[])
{
new Float:health;
new veh;
GetPlayerPos(playerid, OldPos[0], OldPos[1], OldPos[2]);
veh = GetPlayerVehicleID(playerid);
GetVehicleHealth(veh, health);
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, red, "You need to be in a vehicle to use this");
else if(health > 999) return SendClientMessage(playerid,red,"Your vehicles at 100%");
SetTimer("repairtime",10000,false);
SendClientMessage(playerid,green,"Help will arrive in 10 seconds. Please wait.");
return 1;
}

