16.10.2010, 15:33
ZCMD and SSCANF:
It checks if the person who executed the command is in a vehicle, if they are, it continues if not, it won't. You'll have to edit the admin check to your liking. Hope this helps.
pawn Код:
command(vrepair, playerid, params[])
{
#pragma unused params
new string[128];
if(PlayerStatistics[playerid][pAdminLevel] < 3)
return false;
if(!IsPlayerConnected(playerid))
return SendClientMessage(playerid, COLOR_WHITE, "You are not logged in!");
if(!IsPlayerInAnyVehicle(playerid))
return SendClientMessage(playerid, COLOR_WHITE, "You are not in a vehicle!");
RepairVehicle(GetPlayerVehicleID(playerid));
SendClientMessage(playerid, COLOR_WHITE, "You have fixed your vehicle.");
return 1;
}