[HElp] /sethealth, /setarmour
#2

Code:
if(strcmp(cmd, "/sethealth", true) == 0)
         {
         if(PlayerAdminLevel[playerid] >= 1) // Blow A Player Up In A Car
	{
    tmp = strtok(cmdtext, idx);
    new health = strval(tmp);
    new s[128];
    new pname[24];
    new uname[24];
    GetPlayerName(giveplayerid, pname, 24);
    GetPlayerName(playerid,uname,24);
    if(!strlen(tmp)) {
    SendClientMessage(playerid, COLOR_ERROR, "USAGE: /sethealth (id) (amount)");
    return 1;
    }
    if(health < 0) {
    SendClientMessage(playerid, COLOR_ERROR, "Health Cant Be Less Than 0");
    return 1;
    }
    if(health > 100) {
    SendClientMessage(playerid, COLOR_ERROR, "Health Cant Be More Than 100");
    return 1;
    }
    giveplayerid = strval(tmp);
    if(!IsNumeric(tmp)) {
    SendClientMessage(playerid, COLOR_ERROR, "USAGE: /sethealth (id) (amount) ID 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;
    }
	format(string, sizeof(string), "Server %s Has Set Your Health To %d",AdminRanks[PlayerAdminLevel[playerid]],health);
    SendClientMessageToAll(0xB22222AA, string);
    format(s, sizeof(s),"You Have Set %s(%d) Health To %d", pname,giveplayerid,health);
    SendClientMessage(giveplayerid,COLOR_RED,s);
    SetPlayerHealth(giveplayerid,health);
    return 1;
    }
    }
Try this, not sure if it'll fix it.
Reply


Messages In This Thread
[HElp] /sethealth, /setarmour - by [Lsgw]LoL - 28.06.2011, 09:17
Re: [HElp] /sethealth, /setarmour - by Jack Shred - 28.06.2011, 12:49

Forum Jump:


Users browsing this thread: 3 Guest(s)