Jump to content
  • 0

problema comanda /cabinet


Question

Posted

cum fac ca la cabinet sa nu poata lua de mai multe ori aceeasi arma

uitati aici cabinetul

[pawn]    if(strcmp(cmd, "/cabinet7", true) == 0)

{

if(IsPlayerConnected(playerid))

      {

            if(PlayerInfo[playerid][pMember] == 15 || PlayerInfo[playerid][pLeader] == 15)

          {

                if(PlayerToPoint(5,playerid,2373.8506,-1132.3689,1050.8750))

{

                    ShowMenuForPlayer(gunmenu7,playerid);

                    return 1;

}

else

{

SendClientMessage(playerid, COLOR_LICENSES, "Nu te afli in pickupul de la cabinet");

return 1;

}

}

}

  return 1;

}[/pawn]

[pawn]    if(Current == gunmenu7)

{

    switch(row)

    {

            case 0:

        {

      GivePlayerWeapon(playerid, 1, 999);

                SendClientMessage(playerid, COLOR_GREY, "Ai luat de la cabinet un Brass Knuckles");

}

    case 1:

        {

                GivePlayerWeapon(playerid, 4, 999);

                SendClientMessage(playerid, COLOR_GREY, "Ai luat de la cabinet un Knife");

}

case 2:

        {

                GivePlayerWeapon(playerid, 24, 999);

                SendClientMessage(playerid, COLOR_GREY, "Ai luat de la cabinet un Desert Eagle");

}

case 3:

        {

                GivePlayerWeapon(playerid, 29, 999);

                SendClientMessage(playerid, COLOR_GREY, "Ai luat de la cabinet un MP5");

}

case 4:

        {

                GivePlayerWeapon(playerid, 30, 999);

                SendClientMessage(playerid, COLOR_GREY, "Ai luat de la cabinet un AK-47");

}

case 5:

        {

                GivePlayerWeapon(playerid, 43, 999);

                SendClientMessage(playerid, COLOR_GREY, "Ai luat de la cabinet o Camera");

}

case 6:

        {

                SetPlayerHealth(playerid,100);

                SendClientMessage(playerid, COLOR_GREY, "Ai luat de la cabinet 100 HP");

}

}

}[/pawn]

[pawn]  gunmenu7 = CreateMenu("Varios Los Aztecas", 1, 200.0, 100.0, 150.0, 150.0);

  AddMenuItem(gunmenu7, 0, "Brass Knuckles");

  AddMenuItem(gunmenu7, 0, "Knife");

  AddMenuItem(gunmenu7, 0, "Desert Eagle");

  AddMenuItem(gunmenu7, 0, "MP5");

  AddMenuItem(gunmenu7, 0, "AK-47");

  AddMenuItem(gunmenu7, 0, "Camera");[/pawn]

6 answers to this question

Recommended Posts

Posted

Poti face un timer in care sa spui de genu 'ti-ai luat deja o arma revino peste 30 minute' sau daca nu fa o functie care sa verifice arma care o ai la tine si sa faci apoi la /cabinet sa nu mai accepte aceasta functie, ceva de genu.

P.S: Cel mai indicat e sa faci un timer si te va ajuta enorm si iti zic eu ca e mai bine.

Posted

#define SCM                                                                                    SendClientMessage

if ( GetPlayerWeapon ( playerid ) == /* ID ARMA */ ) return SCM ( playerid , -1 , "* Deja detii aceasta arma." ) ;

Posted

@DarkyTheAngel

unde adaug ce mi-ai lasat tu acolo

In comanda, unde in alta parte? el ti-a definit si SCM daca nu il acum cumva.

Posted

@DarkyTheAngel

unde adaug ce mi-ai lasat tu acolo

La public-ul OnPlayerSelectedMenuRow, la fiecare case care tine de arma respectiva.Ex:

    case 0:

    {

        #define SCM  SendClientMessage

        if ( GetPlayerWeapon ( playerid ) == 1 ) return SCM ( playerid , -1 , "* Deja detii aceasta arma." ) ;

        // Asta verifica daca jucatorul are arma respectiva.

        // Daca are arma respectiva, nu o va primi.

        GivePlayerWeapon ( playerid , 1 , 999 ) ;

        // Daca jucatorul nu are arma respectiva, o va primi.

        SCM ( playerid , -1 , "Ai luat de la cabinet un Brass Knuckles" ) ;

    }

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.