08.09.2012, 12:55
Whats wrong with this command? it jsut kilsl the player when i try to use it ingame.
and this string dont work:
any help? There is no errors in the script.
Код:
CMD:sethealth(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playerid, 0x99333300, "You can't make your own commands smartass!"); new PID; new reason[64]; new str[128]; new amount; new Playername[MAX_PLAYER_NAME], Adminname[MAX_PLAYER_NAME]; if(sscanf(params, "u", PID, amount, reason)) return SendClientMessage(playerid, 0xFF0000C8, "USAGE: /sethealth [playerid] [amount] [reason]"); GetPlayerName(playerid, Adminname, sizeof(Adminname)); GetPlayerName(PID, Playername, sizeof(Playername)); if(amount > 100) return SendClientMessage(playerid,0xFF0000FF,"Max 100!");//Available levels if(!IsPlayerConnected(PID)) return SendClientMessage(playerid, 0xFF0000C8, "Player is not Connected!"); format(str,sizeof(str),"%s health have been sat to %s by Admin %s. Reason: %s", Playername, amount, Adminname, reason); SendClientMessageToAll(0xFF0000C8, str); SetPlayerHealth(PID, amount); SendClientMessage(PID, 0xFF000000,"An admin changed you health!"); return 1; }
Код:
CMD:stats(playerid, params[]) { new string[200]; format(string, sizeof(string), "Name: %s ", playerid); SendClientMessage(playerid ,0xFF0000C8, string); format(string, sizeof(string), "Total Kills: %s ", PlayerInfo[playerid][pKills]); SendClientMessage(playerid ,0xFF0000C8, string); format(string, sizeof(string), "Total Deaths: %s ", PlayerInfo[playerid][pDeaths]); SendClientMessage(playerid ,0xFF0000C8, string); format(string, sizeof(string), "9mm kills: %s ", PlayerInfo[playerid][p9mm]); SendClientMessage(playerid ,0xFF0000C8, string); return 1; }