How to create a /setkills and /setdeaths command?
#2

pawn Код:
CMD:setkills(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] == 1337)
    {
        new giveplayerid, kills, string[128];
        if(sscanf(params, "ud", giveplayerid, kills) return SendClientMessage(playerid, -1, "USAGE: /setkills [playerid] [amount]")
       
        if(IsPlayerConnected(giveplayerid))
        {
            new PName[64];
            GetPlayerName(playerid, PName, sizeof(PName));
            PlayerInfo[giveplayerid][Kills] = amount;
            format(string, sizeof(string), "Your kills have been set to %d", amount);
            SendClientMessage(giveplayerid, -1, string);
            format(string, sizeof(string), "You have set %s's kills to %d", PName, amount);
            SendClientMessage(playerid, -1, string);
        }
    }
    else
    {
        SendClientMessage(playerid, -1, "You are not authorized to use this command!");
        return 1;
    }
    return 1;
}
There is /setkills.
You should be able to use that for a guide for /setdeaths, if not, let me know and i'll make that to.

You can also change "1337" to whatever level you want, and "-1" to any color you want.

Hope this helps!
Reply


Messages In This Thread
How to create a /setkills and /setdeaths command? - by OleKristian95 - 19.05.2012, 00:54
Re: How to create a /setkills and /setdeaths command? - by Paramount - 19.05.2012, 01:04
Re: How to create a /setkills and /setdeaths command? - by [ABK]Antonio - 19.05.2012, 01:05
Re: How to create a /setkills and /setdeaths command? - by Paramount - 19.05.2012, 01:08
Re: How to create a /setkills and /setdeaths command? - by OleKristian95 - 19.05.2012, 01:09

Forum Jump:


Users browsing this thread: 1 Guest(s)