system giftbox + GiftHours la payday

Posteaza aici daca ai probleme cu rularea clientului
Post Reply
User avatar
NiTroG3N
Advanced Member
Posts:117
Joined:17 Jan 2016, 12:58
Location:Bucuresti
system giftbox + GiftHours la payday

Post by NiTroG3N » 26 Feb 2016, 10:16

Va rog sa imi dati si mie un siatem giftbox

User avatar
demeze
Founder & CEO
Posts:957
Joined:26 Jul 2009, 12:08
Location:Galati
Contact:

Re: system giftbox + GiftHours la payday

Post by demeze » 26 Feb 2016, 20:49

In primul rand spune ce vrei la el, ce variabile ai in GM si mai multe detalii ca nu avem cum sa ghicim in stele ce doresti.

Plus daca cautai pe forum gaseai topicul acesta: viewtopic.php?f=659&t=21388 unde am postat un sistem de /getgift pe puncte (cate 1 punct la fiecare payday sau cate doresti tu sa setezi), cu modificarile dorite (variabile, constante, etc)

User avatar
NiTroG3N
Advanced Member
Posts:117
Joined:17 Jan 2016, 12:58
Location:Bucuresti

Re: system giftbox + GiftHours la payday

Post by NiTroG3N » 27 Feb 2016, 09:27

Asta este /getgift-ul meu, dar daca un player ese din joc si intra iar poate sa acceseze iar /getgift + ca in baza de date nu se salveaza GiftHours
asta e getgift:

Code: Select all

CMD:getgift(playerid, params[])
{
    if(PlayerInfo[playerid][pPlayingHours] >= 3)
    {
        if(assetVariables[1][aAssetValue] == 1)
        {
            if(IsPlayerInRangeOfPoint(playerid, 15.0, 1799.150634, -1863.718505, 13.574730))
            {
                format(szMessage, 256, "Poti folosi /getgift peste %d ore.", PlayerInfo[playerid][pGiftHours]);
                if(PlayerInfo[playerid][pGiftHours] == 0)
                {
                    new gift = random(10);
                    if(gift == 0)
                    {
                        PlayerInfo[playerid][pRPoints] += 5;
                        SendClientMessage(playerid, COLOR_WHITE, "Ai castigat 5 respect points-uri la giftbox.");
                        format(szMessage, sizeof(szMessage), "(( AdmBot says: %s won 5 respect points at giftbox. ))",GetName(playerid));
                        SCMTA(COLOR_LIGHT,szMessage);
                    }
                    if(gift == 1)
                    {
                        new cash = random(1000000);
                        PlayerInfo[playerid][pMoney] += 100000;
                        SendClientMessage(playerid, COLOR_WHITE, "Ai castigat o suma de bani la giftbox.");
                        format(szMessage, sizeof(szMessage), "(( AdmBot says: %s won $%s at giftbox. ))",GetName(playerid), NumberFormat(cash));
                        SCMTA(COLOR_LIGHT,szMessage);
                    }
                    if(gift == 2)
                    {
                        PlayerInfo[playerid][pRobPoints] += 100;
                        if(PlayerInfo[playerid][pGroup] == 1 || PlayerInfo[playerid][pGroup] == 2 || PlayerInfo[playerid][pGroup] == 3 || PlayerInfo[playerid][pGroup] == 5)
                        {
                            SendClientMessage(playerid, COLOR_WHITE, "Ai castigat 100 lawer points-uri la giftbox.");
                            format(szMessage, sizeof(szMessage), "(( AdmBot says: %s won 100 lawer points at giftbox.  ))",GetName(playerid));
                            SCMTA(COLOR_LIGHT,szMessage);
                        }
                        else
                        {
                            SendClientMessage(playerid, COLOR_WHITE, "Ai castigat 100 rob points-uri la giftbox.");
                            format(szMessage, sizeof(szMessage), "(( AdmBot says: %s won 100 rob points at giftbox.  ))",GetName(playerid));
                            SCMTA(COLOR_LIGHT,szMessage);
                        }
                    }
                    if(gift == 3)
                    {
                        PlayerInfo[playerid][pDriveLicense] += 500;
                        PlayerInfo[playerid][pGunLicense] += 500;
                        PlayerInfo[playerid][pFlyLicense] += 500;
                        PlayerInfo[playerid][pBoatLicense] += 500;
                        SendClientMessage(playerid, COLOR_WHITE, "Ai castigat inca 500 de ore la fiecare licenta de la giftbox.");
                        format(szMessage, sizeof(szMessage), "(( AdmBot says: %s won 5 respect points at giftbox. ))",GetName(playerid));
                        SCMTA(COLOR_LIGHT,szMessage);
                    }
                    if(gift == 4)
                    {
                        PlayerInfo[playerid][pWarns] = 0;
                        SendClientMessage(playerid, COLOR_WHITE, "Ai castigat clear warns de la giftbox.");
                        format(szMessage, sizeof(szMessage), "(( AdmBot says: %s won a warns clear at giftbox. ))",GetName(playerid));
                        SCMTA(COLOR_LIGHT,szMessage);
                        new str[128];
                        format(str,128,"UPDATE playeraccounts SET playerVIP = 0 WHERE playerID = %d",PlayerInfo[playerid][pInternalID]);
                        mysql_tquery(handle, str);
                    }
                        if(gift == 5)
                    {
                        new cash = random(300000);
                        PlayerInfo[playerid][pMoney] += 300000;
                        SendClientMessage(playerid, COLOR_WHITE, "Ai castigat o suma de bani la giftbox.");
                        format(szMessage, sizeof(szMessage), "(( AdmBot says: %s won $%s at giftbox. ))",GetName(playerid), NumberFormat(cash));
                        SCMTA(COLOR_LIGHT,szMessage);
                    }
                    if(gift == 6)
                    {
                        PlayerInfo[playerid][pFPunish] = 0;
                        SendClientMessage(playerid, COLOR_WHITE, "Ai castigat clear FP de la giftbox.");
                        format(szMessage, sizeof(szMessage), "(( AdmBot says: %s won a clear FP at giftbox. ))",GetName(playerid));
                        SCMTA(COLOR_LIGHT,szMessage);
                    }
                    if(gift == 7)
                    {
                        PlayerInfo[playerid][pLevel] += 1;
                        SendClientMessage(playerid, COLOR_WHITE, "Ai castigat un level up de la giftbox.");
                        format(szMessage, sizeof(szMessage), "(( AdmBot says: %s won a level up at giftbox. ))",GetName(playerid));
                        SCMTA(COLOR_LIGHT,szMessage);
                    }

                    if(gift == 9)
                    {
                        PlayerInfo[playerid][pFPunish] = 0;
                        SendClientMessage(playerid, COLOR_WHITE, "Ai castigat clear FP de la giftbox.");
                        format(szMessage, sizeof(szMessage), "(( AdmBot says: %s won a clear FP at giftbox. ))",GetName(playerid));
                        SCMTA(COLOR_LIGHT,szMessage);
                    }
                    PlayerInfo[playerid][pGiftHours] = 4;
                }
                else SCM(playerid,COLOR_YELLOW, szMessage);
            }
            else
            {
                SCM(playerid,COLOR_WHITE, "You are not at giftbox location. Go to checkpoint.");
                SetPlayerCheckpoint(playerid, 1799.150634, -1863.718505, 13.574730, 2);
            }
        }
        else SCM(playerid,COLOR_YELLOW,"Sistem oprit din probleme tehnice");
    }

    else SCM(playerid,COLOR_WHITE, "Ai nevoie de 3 ore jucate pentru a folosi comanda /getgift.");
    return 1;
}

User avatar
SaKaL
Newbie
Posts:29
Joined:19 Nov 2015, 08:09
Location:Tandarei
Contact:

Re: system giftbox + GiftHours la payday

Post by SaKaL » 03 Mar 2016, 17:38

Unde sunt randurile pentru salvarea datelor in DB?

User avatar
demeze
Founder & CEO
Posts:957
Joined:26 Jul 2009, 12:08
Location:Galati
Contact:

Re: system giftbox + GiftHours la payday

Post by demeze » 03 Mar 2016, 19:57

Am mai explicat si in alt topic, iti lipsesc variabile din baza de date + probabil si alte linii pentru update in baza de date..

User avatar
NiTroG3N
Advanced Member
Posts:117
Joined:17 Jan 2016, 12:58
Location:Bucuresti

Re: system giftbox + GiftHours la payday

Post by NiTroG3N » 05 Mar 2016, 17:05

Ma poti ajuta?

Post Reply

Return to “Suport”

Who is online

Users browsing this forum: No registered users and 1 guest