Jump to content
Autentificarea cu Google și Facebook nu mai este disponibilă. ×

Recommended Posts

Posted (edited)

Salut, astazi ma-m gandit sa fac un tutorial la comanda /bonus si eu am fost incepator(si inca sunt) si nu gaseam un tutorial bun asa ca sa incepem:

eu folosesc ZCMD asa ca o sa il includem(avem nevoie de el in include-uri)

#include     <ZCMD>

definim SCM

#define SCM SendClientMessage

enum-urile

enum pInfo {
    pLevel,
    pAdmin,
    pPremiumPoints
};
new PlayerInfo[MAX_PLAYERS][pInfo];

definim culorile pentru a nu ne da errori

//colors 
#define COLOR_ERROR         0xC0241FFF
#define COLOR_LIGHTGREEN     0x9ACD32AA

o prescurtarea pentru a ne ajuta sa fie gamemode ul mai clean

continuam prin a face comanda

CMD:bonus(playerid, params[], help) {

}

acum o sa facem ca daca nu ai level 1 o sa iti de a eroare ai primit deja acest bonus

CMD:bonus(playerid, params[], help) {
    if(PlayerInfo[playerid][pLevel] == 5 ) return SCM(playerid, COLOR_ERROR, "Eroare: ai primit deja acest bonus.");
    else { //aici inseamna ca si cum daca nu are level 5 sa iti de a chestiile astea de mai jos
        SCM(playerid, COLOR_LIGHTGREEN, "(SERVER): Felicitari!! Ai primit bonusul de incepator.");
        SCM(playerid, COLOR_LIGHTGREEN, "(SERVER): Ai primit 100.000.000$     ");
        SCM(playerid, COLOR_LIGHTGREEN, "(SERVER): Ai primit level 5          ");
        SCM(playerid, COLOR_LIGHTGREEN, "(SERVER): Ai primit 50 Premium Points");
    }    

acum urmeaza urmatoarea parte in care sa primesti bonusul in sine

CMD:bonus(playerid, params[], help) {
    if(PlayerInfo[playerid][pLevel] == 5 ) return SCM(playerid, COLOR_ERROR, "Eroare: ai primit deja acest bonus.");
    else {
        SCM(playerid, COLOR_LIGHTGREEN, "(SERVER): Felicitari!! Ai primit bonusul de incepator.");
          SCM(playerid, COLOR_LIGHTGREEN, "(SERVER): Ai primit 100.000.000$     ");
        SCM(playerid, COLOR_LIGHTGREEN, "(SERVER): Ai primit level 5          ");
        SCM(playerid, COLOR_LIGHTGREEN, "(SERVER): Ai primit 50 Premium Points");
    }    
    GivePlayerMoney(playerid, 10000000);
    SetPlayerScore(playerid, 5);
    PlayerInfo[playerid][pLevel] += 5;
    PlayerInfo[playerid][pPremiumPoints] += 50;
    return 1;
}

incercati sa invatati cu o comanda  mai simpla la inceput ca si:

CMD:bonus(playerid, params[], help) {
  setplayerscore(playerid, 5);
  giveplayermoney(playerid, 10000000);
  return 1:
}

si usor usor o sa invatati si comenzi mai avansate.

tiin sa mentionez ca inca sunt incepator si asa am stiut sa explic, expertii pot sa de a un reply cu o metoda mai buna.

Edited by ImDariusHere
Posted (edited)

1000 de culori definite si folosesti decat 2

Edited by AlexxAdv

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • 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.