Jump to content

Cine imi poate explica comanda aceasta /getgift


Byzzi4life

Recommended Posts

CMD:getgift(playerid, params[])
{
    if(PlayerInfo[playerid][pGetGift] < 3)
    {
        new ent[128],rot[128];
        format(ent, sizeof ent, "You can use /getgift in %d hours.", 3-PlayerInfo[playerid][pGetGift]);
        format(rot, sizeof rot, "Poti folosii /getgift in %d ore.", 3-PlayerInfo[playerid][pGetGift]);
        Error(playerid, ent, rot);
        return 1;
    }
    if(!IsPlayerInRangeOfPoint(playerid, 5.0, 1128.9360,-1449.3734,15.7969))
    {
        Error(playerid, "You are not at the GiftBox.", "Nu esti la GiftBox.");
        SetPlayerCP(playerid, 1128.9360,-1449.3734,15.7969, 4.0);
        return 1;
    } --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------de aIci
    new ent[128],rot[128],name[MAX_PLAYER_NAME+1];
    GetPlayerName(playerid, name, sizeof name);
    new randgift = random(20);
    if(randgift == 1 || randgift == 5 || randgift == 9 || randgift == 15 || randgift == 6 ||  randgift > 16)
    {
        new amount = 500000 + random(5000000);
        format(ent, sizeof ent, "* GiftBox: %s has won $%s from the GiftBox!", name, FormatNumber(amount));
        format(rot, sizeof rot, "* GiftBox: %s a castigat $%s din GiftBox!", name, FormatNumber(amount));
        GivePlayerCash(playerid, amount);
    }
    if(randgift == 2 || randgift == 7  || randgift == 0)
    {
        new Float:amount = 30.0;
        format(ent, sizeof ent, "* GiftBox: %s has won %0.2f EUR from the GiftBox!", name, amount);
        format(rot, sizeof rot, "* GiftBox: %s a castigat %0.2f EUR din GiftBox!", name, amount);
        PlayerInfo[playerid][pEUR] += amount;
    }
    if(randgift == 3 || randgift == 8 || randgift == 10 || randgift == 16)
    {
        new amount = 1 + random(5);
        format(ent, sizeof ent, "* GiftBox: %s has won %d Respect Points from the GiftBox!", name, amount);
        format(rot, sizeof rot, "* GiftBox: %s a castigat %d Puncte de Respect din GiftBox!", name, amount);
        PlayerInfo[playerid][pRP] += amount;
    }
    if(randgift == 4 || randgift == 11 || randgift == 12 || randgift == 13 || randgift == 14)
    {
        new amount = 1 + random(5);
        format(ent, sizeof ent, "* GiftBox: %s has won %d Rob Points from the GiftBox!", name, amount);
        format(rot, sizeof rot, "* GiftBox: %s a castigat %d Puncte de Jaf din GiftBox!", name, amount);
        PlayerInfo[playerid][pRob] += amount;
    }
    if(randgift == 0)
    {
        PlayerInfo[playerid][pLevel]++;
        format(ent, sizeof ent, "* GiftBox: %s has won Level UP from the GiftBox!", name);
        format(rot, sizeof rot, "* GiftBox: %s a castigat Level UP din GiftBox!", name);
    }-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------pana aici
    PlayerInfo[playerid][pGetGift] = 0;
    loop(Character, i)
    {
        SM(i, 0x9DDDF2FF, ent, rot);
    }
    SavePlayerData(playerid);
    return 1;
}

Link to comment
Share on other sites

  • 2 weeks later...

CMD:getgift(playerid, params[])
{
    if(PlayerInfo[playerid][pGetGift] < 3) // Se verifica punctele pe care le are stocate in variabile pGetGift.
    {
        new ent[128],rot[128]; // String-urile create pentru mesaje.
        format(ent, sizeof ent, "You can use /getgift in %d hours.", 3-PlayerInfo[playerid][pGetGift]); // formatarea string-ului
        format(rot, sizeof rot, "Poti folosii /getgift in %d ore.", 3-PlayerInfo[playerid][pGetGift]); // formatarea string-ului
        Error(playerid, ent, rot); // Presupun ca un public pentru care ii arata mesajul in romana/engleza.
        return 1; // returneaza cu 1 pentru a nu continua comanda.
    }
    if(!IsPlayerInRangeOfPoint(playerid, 5.0, 1128.9360,-1449.3734,15.7969)) // Verifica daca jucatorul se afla in acele coordonate.
    {
        Error(playerid, "You are not at the GiftBox.", "Nu esti la GiftBox."); // Presupun ca un public pentru care ii arata mesajul in romana/engleza. 
        SetPlayerCP(playerid, 1128.9360,-1449.3734,15.7969, 4.0);   // Ii seteaza un checkpoint, alt public facut de catre creator.
        return 1; // returneaza cu 1 pentru a nu continua comanda.
    } --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------de aIci
    new ent[128],rot[128],name[MAX_PLAYER_NAME+1]; // Variabile
    GetPlayerName(playerid, name, sizeof name); // Salveaza numele jucatorului in variabile name.
    new randgift = random(20); // variabila pentru norocul sau la paintball
    if(randgift == 1 || randgift == 5 || randgift == 9 || randgift == 15 || randgift == 6 ||  randgift > 16) // verifica daca are numarul acela 1, 5, 9, 15, 6, 16
    {
        new amount = 500000 + random(5000000); // variabile pentru a-i da o suma random de bani
        format(ent, sizeof ent, "* GiftBox: %s has won $%s from the GiftBox!", name, FormatNumber(amount)); // formatarea string-ului
        format(rot, sizeof rot, "* GiftBox: %s a castigat $%s din GiftBox!", name, FormatNumber(amount)); // formatarea string-ului
        GivePlayerCash(playerid, amount); // I da bani la jucator
    }
    if(randgift == 2 || randgift == 7  || randgift == 0) // verifica daca are numarul acela 2 7 0 
    {
        new Float:amount = 30.0; // variabile pentru a-i da o suma random
        format(ent, sizeof ent, "* GiftBox: %s has won %0.2f EUR from the GiftBox!", name, amount); // formatarea string-ului
        format(rot, sizeof rot, "* GiftBox: %s a castigat %0.2f EUR din GiftBox!", name, amount); // formatarea string-ului
        PlayerInfo[playerid][pEUR] += amount; // I salveaza jucatorului ce a primit
    }
    if(randgift == 3 || randgift == 8 || randgift == 10 || randgift == 16) // verifica daca are numarul acela 3 8 10 16
    {
        new amount = 1 + random(5); // variabile pentru a-i da o suma random de rp
        format(ent, sizeof ent, "* GiftBox: %s has won %d Respect Points from the GiftBox!", name, amount); // formatarea string-ului
        format(rot, sizeof rot, "* GiftBox: %s a castigat %d Puncte de Respect din GiftBox!", name, amount); // formatarea string-ului
        PlayerInfo[playerid][pRP] += amount; // I salveaza jucatorului ce a primit
    }
    if(randgift == 4 || randgift == 11 || randgift == 12 || randgift == 13 || randgift == 14) // verifica daca are numarul acela 4 11 12 13 14
    {
        new amount = 1 + random(5); // variabile pentru a-i da o suma random de rob points
        format(ent, sizeof ent, "* GiftBox: %s has won %d Rob Points from the GiftBox!", name, amount); // formatarea string-ului
        format(rot, sizeof rot, "* GiftBox: %s a castigat %d Puncte de Jaf din GiftBox!", name, amount); // formatarea string-ului
        PlayerInfo[playerid][pRob] += amount; // I salveaza jucatorului ce a primit
    }
    if(randgift == 0) // verifica daca are numarul acela 0
    {
        PlayerInfo[playerid][pLevel]++;// I salveaza jucatorului ce a primit
        format(ent, sizeof ent, "* GiftBox: %s has won Level UP from the GiftBox!", name);// formatarea string-ului
        format(rot, sizeof rot, "* GiftBox: %s a castigat Level UP din GiftBox!", name);// formatarea string-ului
    }-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------pana aici
    PlayerInfo[playerid][pGetGift] = 0; // reseteaza punctele din variabile pGetGift pentru a nu putea sa o mai foloseasca inca o data
    loop(Character, i) 
    {
        SM(i, 0x9DDDF2FF, ent, rot); // trimite mesajul jucatorului
    }
    SavePlayerData(playerid); // public creat *posibil pentru salvarea datelor/progresului jucatorului
    return 1; // returneaza cu 1 ca sa se termine comanda
}

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.