Jump to content

Comanda /set


TheSlim2

Recommended Posts

  • 4 weeks later...

Aceasta sectiune nu este pentru a face comenzile la comanda cum vreti voi, aveti sa-mp.wiki , aveti o gramada, alti scripteri de acum nu avusera in 2012 cunostintele de acum si nu intrebau, "imi faci un gamemode da sa fie frumos sa-l vad", pune mana si invata daca vrei, daca nu, asta e, nu suntem obligati sa dam oricui o comanda/stock etc, o zi faina.

Link to comment
Share on other sites

  • 3 years later...

CMD:set(playerid, params[])

{

    if (!IsPlayerConnected(playerid)) return 0;

 

    if (!IsPlayerAdmin(playerid))

    {

        SendClientMessage(playerid, -1, "You are not authorized to use this command.");

        return 1;

    }

 

    new targetid, attribute, value;

    if (sscanf(params, "iii", targetid, attribute, value))

    {

        if (!IsPlayerConnected(targetid))

        {

            SendClientMessage(playerid, -1, "Target player is not connected.");

            return 1;

        }

 

        switch (attribute)

        {

            case 1: // Money

                GivePlayerMoney(targetid, value);

                SendClientMessage(playerid, -1, "You've set the player's money.");

                break;

 

            case 2: // PP

                SetPlayerPP(targetid, value);

                SendClientMessage(playerid, -1, "You've set the player's PP.");

                break;

 

            case 3: // Giftpoints

                SetPlayerGiftPoints(targetid, value);

                SendClientMessage(playerid, -1, "You've set the player's Giftpoints.");

                break;

 

 

            default:

                SendClientMessage(playerid, -1, "Invalid attribute ID.");

                break;

        }

    }

    else

    {

        SendClientMessage(playerid, -1, "Usage: /set [playerid] [attribute] [value]");

    }

 

    return 1;

}

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.