Jump to content
  • 0

modificat comanda


SaLiErY

Question

salut care imi poate modificat si mie comanda de /sellmats ca sa ceara si bani pe de ex  /sellmats (id) (cate materiale) (suma) iar la cel care le vand sa trebuiasca sa dea /accest mats si sa ii scata suma de bani pe care se cere la /sellmats

if(strcmp(cmd,"/sellmats",true)==0)

{

    if(IsPlayerConnected(playerid))

    {

        if(PlayerInfo[playerid][pJob] != 9)

        {

            SendClientMessage(playerid, COLOR_GREY, "  You're not the materials dealer ! ");

            return 1;

        }

        tmp = strtok(cmdtext, idx);

        if(!strlen(tmp))

        {

            SendClientMessage(playerid, COLOR_WHITE, "HINT: /sellmats [playerid/PartOfName] [ammount]");

            return 1;

        }

        giveplayerid = ReturnUser(tmp);

        if(IsPlayerConnected(giveplayerid))

        {

            if(giveplayerid != INVALID_PLAYER_ID)

            {

if(ProxDetectorS(5.0, playerid, giveplayerid))

{

    tmp = strtok(cmdtext, idx);

    if(!strlen(tmp))

    {

        SendClientMessage(playerid, COLOR_WHITE, "HINT: /sellmats [playerid/PartOfName] [ammount]");

            return 1;

    }

    new ammount = strval(tmp);

    if(ammount < 1) { SendClientMessage(playerid, COLOR_GREY, "  Wrong ammount ! "); return 1; }

    if(ammount > PlayerInfo[playerid][pMats]) { SendClientMessage(playerid, COLOR_GREY, "  You don't have so many materials to sell !"); return 1; }

    PlayerInfo[playerid][pMats] -= ammount;

    PlayerInfo[giveplayerid][pMats] += ammount;

GetPlayerName(playerid, sendername, sizeof(sendername));

GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));

format(string, sizeof(string), "* %s gives a package of materials to %s", sendername, giveplayer);

ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);

}

else

{

    SendClientMessage(playerid, COLOR_GREY, "  Player is not near you ! ");

    return 1;

}

            }

        }

    }

    return 1;

}

comanda este aici sper sa ma puteti ajuta multumesc mult

Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Guest
This topic is now closed to further replies.
×
×
  • 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.