15.12.2012, 05:07
EDIT: its fixed
When i type this cmd
it returns INVALID_CMD ( message sends "unkown command" ) xD
here is the command
When i type this cmd
it returns INVALID_CMD ( message sends "unkown command" ) xD
here is the command
pawn Код:
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;
}