22.02.2015, 16:56
Try this:
You'd have to edit it so it fits your stocks. I couldn't understand all of them so I did my best.
Код:
CMD:sethealth( playerid, params[] ) { new targetid, Float:newhealth; if(!IsAdminLevel(playerid, 1)) return SendClientMessage(playerid, COLOR_RED, "You need a higher administrator level to use this command!"); if(sscanf(params, "ui", targetid, newhealth)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /sethealth [playerid] [health]"); if(targetid == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Playerid is not an active ID."); if(targetid == playerid) { format(string, sizeof(string), "You have succesfully set your health to %f", newhealth); SendClientMessage(playerid, COLOR_YELLOW, string); SetPlayerHealth(playerid, newhealth); return 1; } else { format(string, sizeof(string), "You have succesfully set %s's health to %f", GetName(targetid), newhealth); SendClientMessage(playerid, COLOR_YELLOW, string); format(string, sizeof(string), "Administrator %s has set your health to %f", GetName(playerid), newhealth); SetPlayerHealth(targetid, newhealth); return 1; } return 0; }