Multiple uses of /set
#2

pawn Код:
if(strcmp(cmd, "/sethp", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /sethp [playerid/PartOfName] [health]");
            new playa;
            new health;
            playa = ReturnUser(tmp);
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /sethp [playerid/PartOfName] [health]");
            health = strvalEx(tmp);
            if(PlayerInfo[playerid][pAdmin] >= 4)
            {
                if(IsPlayerConnected(playa))
                {
                    if(playa != INVALID_PLAYER_ID)
                    {
                        SetPlayerHealth(playa, health);
                        format(string, sizeof(string), "   You have set %s's health to %d !",PlayerName(playa),health);
                        SendClientMessage(playerid, COLOR_GREY, string);
                    }
                }
            }
            else SendClientMessage(playerid, COLOR_GRAD1, "   You are not authorized to use that command !");
        }
        return 1;
    }
    if(strcmp(cmd, "/setarmor", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /setarmor [playerid/PartOfName] [armor]");
            new playa;
            new armor;
            playa = ReturnUser(tmp);
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /sethp [playerid/PartOfName] [armor]");
            armor = strvalEx(tmp);
            if(PlayerInfo[playerid][pAdmin] >= 4)
            {
                if(IsPlayerConnected(playa))
                {
                    if(playa != INVALID_PLAYER_ID)
                    {
                        GetPlayerName(playa, giveplayer, sizeof(giveplayer));
                        SetPlayerArmour(playa, armor);
                        format(string, sizeof(string), "   You have set %s's armor to %d !", giveplayer,armor);
                        SendClientMessage(playerid, COLOR_GREY, string);
                    }
                }
            }
            else SendClientMessage(playerid, COLOR_GRAD1, "   You are not authorized to use that command !");
        }
        return 1;
    }
Reply


Messages In This Thread
Multiple uses of /set - by cloudysky - 12.07.2011, 16:07
Re: Multiple uses of /set - by WoodPecker - 12.07.2011, 16:14
Re: Multiple uses of /set - by Antonio144 - 12.07.2011, 16:25
Re: Multiple uses of /set - by cloudysky - 12.07.2011, 16:26
Re: Multiple uses of /set - by Wesley221 - 12.07.2011, 16:33

Forum Jump:


Users browsing this thread: 1 Guest(s)