PUBLIC:vr(playerid, vehicleid)
{
new Float:x,Float:y,Float:z;
GetVehiclePos(vehicleid, x,y,z);
if(IsPlayerInRangeOfPoint(playerid, 3.0,x,y,z)) {
new Float:health; GetVehicleHealth(vehicleid, health);
if(health < 100) {
SetVehicleHealth(vehicleid, health+15);
}else {
SetVehicleHealth(vehicleid, 100.0);
KillTimer(Timer1[playerid]);
SendClientMessage(playerid, COLOR_RED,"[ERROR] Vehicle is repaired");
}
}
return 1;
}
CMD:rv(playerid, params[])
{
if(IsPlayerVS[playerid] == 0) {
SendClientMessage(playerid, COLOR_RED,"[ERROR] You cant use this command, only Vehicle Support can");
return 1;
}
new vehicleid;
if(sscanf(params,"i",vehicleid)) {
SendClientMessage(playerid, COLOR_GREY,"[USAGE] /rv [vehicleid]");
return 1;
}
if(vehicleid == INVALID_VEHICLE_ID) {
SendClientMessage(playerid, COLOR_RED,"[ERROR] Invalid ID");
return 1;
}
new Float:x,Float:y,Float:z;
GetVehiclePos(vehicleid, x,y,z);
if(IsPlayerInRangeOfPoint(playerid, 3.0,x,y,z)) {
Timer1[playerid] = SetTimerEx("vr",500,0,"ii",playerid,vehicleid);
}else {
SendClientMessage(playerid, COLOR_RED,"[ERROR] Your not near that vehicle");
}
return 1;
}
PUBLIC:vr(playerid, vehicleid) { new Float ![]() GetVehiclePos(vehicleid, x,y,z); if(IsPlayerInRangeOfPoint(playerid, 3.0,x,y,z)) { new Float:health; GetVehicleHealth(vehicleid, health); if(health < 100) { SetVehicleHealth(vehicleid, health+15); }else { SetVehicleHealth(vehicleid, 100.0); KillTimer(Timer1[playerid]); SendClientMessage(playerid, COLOR_RED,"[ERROR] Vehicle is repaired"); } } return 1; } |
What is this, a new type of command creation? PUBLIC: ?
And lol'ed. |
#define PUBLIC:%1(%2) forward %1(%2); public %1(%2)