SA-MP Forums Archive
How can i do cmd like /tag id Tag? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: How can i do cmd like /tag id Tag? (/showthread.php?tid=251627)



Solved - Sensitive - 27.04.2011

Solved


Re: How can i do cmd like /tag id Tag? - [L3th4l] - 27.04.2011

pawn Код:
CMD:tag(playerid, params[])
{
    new
        pID,
        iName[MAX_PLAYER_NAME],
        iTags[15],
        nName[MAX_PLAYER_NAME];

    if(sscanf(params, "ui", pID, params)) return SendClientMessage(playerid, COLOR_RED, "Usage: /Tag < Player ID > < Tag >"),
    SendClientMessage(playerid, COLOR_RED, "Tag IDs: 0 - Owner  1 - Mod   2 - sMod   3 - AdvancedPlayer");

    if(!IsPlayerConnected(pID)) return 0;

    switch(strval(params))
    {
        case 0: iTag = "Owner";
        case 1: iTag = "Mod";
        case 2: iTag = "sMod";
        case 3: iTag = "AdvancedPlayer";
    }

    GetPlayerName(playerid, iName, sizeof(iName));

    format(nName, sizeof(nName), "[%s]%s", iTag, iName);
    SetPlayerName(pID, nName); // Setting the player's name AND the tag

    return 1;
}