28.06.2011, 11:16
Код:
if(strcmp(cmd, "/setarmour", true) == 0 && PlayerAdminLevel[playerid] >= 1) // Gives a player money { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_ERROR, "USAGE: /setarmour (id) (amount)"); return 1; } if(!IsNumeric(tmp)) { SendClientMessage(playerid, COLOR_ERROR, "USAGE: /setarmour (id) (amount) ID Must be a number"); return 1; } giveplayerid = strval(tmp); if(!IsPlayerConnected(giveplayerid)) { format(string, sizeof(string), "ID (%d) is not an active player", giveplayerid); SendClientMessage(playerid, COLOR_ERROR, string); return 1; } new sendername[24]; new receivername[24]; GetPlayerName(playerid,sendername, 24); GetPlayerName(giveplayerid,receivername, 24); tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_ERROR, "USAGE: /setarmour (id) (amount)"); return 1; } if(!IsNumeric(tmp)) { SendClientMessage(playerid, COLOR_ERROR, "USAGE: /setarmour (id) (amount) Amount must be a number"); return 1; } if(!IsPlayerConnected(giveplayerid)) { format(string, sizeof(string), "ID (%d) Is not an active player",giveplayerid); SendClientMessage(playerid, COLOR_ERROR, string); return 1; } new s[128]; new pname[24]; GetPlayerName(giveplayerid,pname,24); new armour = strval(tmp); SetPlayerArmour(giveplayerid,armour); if(armour < 0 || armour > 100)return SendClientMessage(playerid,COLOR_ERROR,"Armour Cant Be Less Than 0 And More Than 100"); format(string, sizeof(string), "Server %s Has Set Your Armour To %d",AdminRanks[PlayerAdminLevel[playerid]],armour); SendClientMessage(giveplayerid,0xB22222AA, string); format(s, sizeof(s),"You Have Set %s(%d) Armour To %d", pname,giveplayerid,armour); SendClientMessage(giveplayerid,COLOR_RED,s); return 1; }
Код:
if(armour < 0 || armour > 100)return SendClientMessage(playerid,COLOR_ERROR,"Armour Cant Be Less Than 0 And More Than 100");