Jump to content
  • 0

Erroare nu se salveaza giftpoints


Unique

Question

Buna ziua acum 1-2 ore am implementat sistemul /getgift , totul merge perfect !

Imi da la fiecare payday 1 giftpoint's , merge sa iau cadourile , merge sa dau la toti giftpoints merge tot.

Problema este ca daca ies de pe server nu mi se salveaza giftpoint's ! 

E urgent puteti sa-mi dati o solutie ?

Link to comment
Share on other sites

7 answers to this question

Recommended Posts

  • 0

CMD:getgift(playerid, params[])

{
    if(gLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to login first."); // Verifica daca-i logat
    if(PlayerInfo[playerid][pGift] == 0) return SendClientMessage(playerid, COLOR_WHITE, "Ai nevoie de minim 1 Gift Point pentru a putea folosi comanda."); // Iii trimite un mesaj daca nu are giftpoints

    switch(random(6)) // Aici e facut sa iti deie randem din cele 2 case-uri tu poti adauga case 3 case 4 etc.. si pentru fiecare case nou modifici in switch(random(3)) switch(random(4))  sau cate ai.
     {
        case 0:
        {
            new rp = 1 + random(5);// Aici poti baga sa-i adauge cat rp vrei tu eu am pus 5
            format(gString,sizeof(gString),"* Ai primit %s puncte de respect.",FormatNumber(rp));
            SendClientMessage(playerid, COLOR_SYN, gString);//aici afiseaza mesajul
            PlayerInfo[playerid][pGift] -= 1;
            Update(playerid, pGiftx);
            PlayerInfo[playerid][pRespect] += rp;
            Update(playerid, pRespectx);
            GameTextForPlayer(playerid, "~g~ Ai primit puncte de respect !", 5000, 1);
        }
        case 1:
        {
            new cash = 100000 + random(1000000); // Castiga o suma de bani 100.000 $ + random din suma de 200.000 $
            format(gString,sizeof(gString),"* Ai primit %s$.",FormatNumber(cash)); // aici il scrie
            SendClientMessage(playerid, COLOR_SYN, gString);//aici afiseaza mesajul
            PlayerInfo[playerid][pGift] -= 1;
            Update(playerid, pGiftx);
            GivePlayerCash(playerid, cash);
            GameTextForPlayer(playerid, "~g~Ai primit bani !", 5000, 1);
        }
                case 2:
        {
            new rob = 1 + random(3); // Castiga o suma de bani 100.000 $ + random din suma de 200.000 $
            format(gString,sizeof(gString),"* Ai primit %s puncte de rob.",FormatNumber(rob)); // aici il scrie
            SendClientMessage(playerid, COLOR_SYN, gString);//aici afiseaza mesajul
            PlayerInfo[playerid][pGift] -= 1;
            Update(playerid, pGiftx);
            PlayerInfo[playerid][pRob] += rob;
            Update(playerid, pRobx);
            GameTextForPlayer(playerid, "~g~Au primit puncte rob !", 5000, 1);
        }
                case 3:
        {
            new mats = 1000 + random(5000); // Castiga o suma de bani 100.000 $ + random din suma de 200.000 $
            format(gString,sizeof(gString),"* Ai primit %s materiale.",FormatNumber(mats)); // aici il scrie
            SendClientMessage(playerid, COLOR_SYN, gString);//aici afiseaza mesajul
            PlayerInfo[playerid][pGift] -= 1;
            Update(playerid, pGiftx);
            PlayerInfo[playerid][pMats] += mats;
            Update(playerid, pMatsx);
            GameTextForPlayer(playerid, "~g~Ai primit materiale !", 5000, 1);
        }
                case 4:
        {
            new drugs = 10 + random(50); // Castiga o suma de bani 100.000 $ + random din suma de 200.000 $
            format(gString,sizeof(gString),"* Ai primit %s droguri.",FormatNumber(drugs)); // aici il scrie
            SendClientMessage(playerid, COLOR_SYN, gString);//aici afiseaza mesajul
            PlayerInfo[playerid][pGift] -= 1;
            Update(playerid, pGiftx);
            PlayerInfo[playerid][pDrugs] += drugs;
            Update(playerid, pDrugsx);
            GameTextForPlayer(playerid, "~g~Ai primit droguri !", 5000, 1);
        }
                case 5:
        {
            new hoursplayed = 1 + random(5); // Castiga o suma de bani 100.000 $ + random din suma de 200.000 $
            format(gString,sizeof(gString),"* Ai primit %s ore.",FormatNumber(hoursplayed)); // aici il scrie
            SendClientMessage(playerid, COLOR_SYN, gString);//aici afiseaza mesajul
            PlayerInfo[playerid][pGift] -= 1;
            Update(playerid, pGiftx);
            PlayerInfo[playerid][pHoursPlayed] += hoursplayed;
            Update(playerid, pHoursPlayedx);
            GameTextForPlayer(playerid, "~g~Ai primit ore !", 5000, 1);
        }

    }
    return 1;
}

Edited by Unique
Link to comment
Share on other sites

  • 0
Acum 20 ore, Unique a spus:

Buna ziua acum 1-2 ore am implementat sistemul /getgift , totul merge perfect !

Imi da la fiecare payday 1 giftpoint's , merge sa iau cadourile , merge sa dau la toti giftpoints merge tot.

Problema este ca daca ies de pe server nu mi se salveaza giftpoint's ! 

E urgent puteti sa-mi dati o solutie ?

Salut, am vazut ca nu te-a lamurit nimeni cu problema ta ... te ajut eu , nu stiu 100% daca merge ca difera de GameMode, dar macar hai sa incercam ..

Bun, deci te duci in baza de date si creezi un nou "column" numit "GPoints" , recomand sa il pui ultimul, dupa ce termini asta deschizi GM-ul si te duci in public Update(playerid, type) si la sfarsit bagi asta

case pGiftx:
{                  mysql_format(SQL,var,sizeof(var),"UPDATE`users`SET`GPoints`='%d'WHERE`name`='%s'",PlayerInfo[playerid[pGift],PlayerInfo[e];
mysql_tquery(SQL,var,"","");
}

sper ca te-am ajutat.. succes!

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
Answer this question...

×   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.