02.01.2012, 15:27
Hi, i have made a admin heal command.. everything works fine excpect :
1. it does not set the ammount of health i tell him to.. health 1 works, if i put at the health 2 it makes it 66366 or something..
2. It sends a message to me that i have set the players hp to that ammount and it gives the player the message that he got that much hp from me.. that works perfect but it also sends the message whats supossed to go to the player back to me.. so i receieve :
''Enrico (id) has set your HP to ''HP''
"You have set's ''PLAYER's'' hp to ''HP''
Help pleasE?
1. it does not set the ammount of health i tell him to.. health 1 works, if i put at the health 2 it makes it 66366 or something..
2. It sends a message to me that i have set the players hp to that ammount and it gives the player the message that he got that much hp from me.. that works perfect but it also sends the message whats supossed to go to the player back to me.. so i receieve :
''Enrico (id) has set your HP to ''HP''
"You have set's ''PLAYER's'' hp to ''HP''
Help pleasE?
Код:
CMD:aheal(playerid, params[]) { new targetid, Float:health, targetname[MAX_PLAYER_NAME], string[70], string2[70]; if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_RED, "This command is only for administrators!"); if(sscanf(params,"ur", targetid, health)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /aheal [playerid/partofname] [health]"); else if(targetid == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Invalid player ID!"); else { SetPlayerHealth(targetid, health); GetPlayerName(targetid, targetname, MAX_PLAYER_NAME); format(string, sizeof(string), "You've set %s's (%d) health to %d.", targetname, targetid, health); SendClientMessage(playerid,COLOR_WHITE,string); format(string2, sizeof(string2), "%s has set your health to %d.", playerid, health); SendClientMessage(targetid,COLOR_WHITE,string2); } return 1; }