Jump to content

Recommended Posts

Posted

Buna ziua,am si eu o problema cu un system det /getgift.

GameMode = wa-rpg

Am dat ctrl+f sa caut /getgift  = 

 

YCMD:getgift(playerid, params[], help) {
    if(SpecialWeek == 0) return SCM(playerid, COLOR_LGREEN, "Giftbox-ul nu este activ!");
    new string[180], won[256];
    if(PlayerInfo[playerid][pGiftPoints] >= 100)
    {
        if(PlayerInfo[playerid][pConnectTime] < 1) return SCM(playerid, COLOR_LGREEN, "Ai nevoie de 2 ore jucate pentru a putea lua acest cadou!");
        if(PlayerToPoint(25.0, playerid, 192.0716,-1825.4077,7.2670))
        {
            new rand = random(310);
            PlayerInfo[playerid][pGiftPoints] = 100;
            Update(playerid, pGiftPointsx);
            if(rand < 270)
            {
                new randmoney = 1000000 + random(4500000);
                PlayerInfo[playerid][pCash] += randmoney;
                GivePlayerCash(playerid, randmoney);
                format(won, sizeof(won), "Ai castigat $%s din gift box!", FormatNumber(randmoney));
                format(string, sizeof(string), "%s a castigat $%s din giftbox.", GetName(playerid), FormatNumber(randmoney));
                InsertLog(playerid, string, LOG_GIFTBOX);
                ProxDetector(30.0,playerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);    
                GiftMoney += randmoney;
            }
            else if(rand >= 270 && rand < 280)
            {
                new randrp = 2 + random(6);
                PlayerInfo[playerid][pPremiumPoints] += randrp;
                Update(playerid, pPremiumPointsx);
                format(won, sizeof(won), "Ai castigat %d puncte premium din gift box!", randrp);
                format(string, sizeof(string), "%s a castigat %d puncte premium din giftbox.", GetName(playerid), randrp);
                InsertLog(playerid, string, LOG_GIFTBOX);    
                ProxDetector(30.0,playerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);    
                GiftGold += randrp;
                format(string, sizeof(string), "(( AdmBot: %s a castigat %d puncte premium din giftbox! ))", GetName(playerid), randrp);
                SendClientMessageToAll(COLOR_CLIENT, string);                
            }            
            else if(rand >= 280 && rand < 297)
            {
                new randrp = 1 + random(4);
                PlayerInfo[playerid][pExp] += randrp;
                Update(playerid, pRP);
                format(won, sizeof(won), "Ai castigat %d respect points din gift box!", randrp);
                format(string, sizeof(string), "%s a castigat %d RP-uri din giftbox.", GetName(playerid), randrp);
                InsertLog(playerid, string, LOG_GIFTBOX);
                ProxDetector(30.0,playerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);        
                GiftRP += randrp;
                UpdateProgress(playerid, 0);
            }            
            else if(rand >= 297 && rand <= 300) {
                if(GiftVehicle < 60) {
                    if(GetSlots(playerid) == GetVehicles(playerid)) {
                        new randmoney = 1000000 + random(4500000);
                        PlayerInfo[playerid][pCash] += randmoney;
                        GivePlayerCash(playerid, randmoney);
                        format(won, sizeof(won), "Ai castigat $%s din gift box!", FormatNumber(randmoney));
                        format(string, sizeof(string), "%s a castigat $%s din giftbox.", GetName(playerid), FormatNumber(randmoney));
                        InsertLog(playerid, string, LOG_GIFTBOX);
                        ProxDetector(30.0,playerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);    
                        GiftMoney += randmoney;                
                    }
                    else {
                        GiftVehicle++;
                        format(won, sizeof(won), "Felicitari! Ai castigat vehiculul Stretch din giftbox.");
                        GiveVehicle(playerid, 409);
                        format(string, sizeof(string), "(( AdmBot: %s a castigat vehiculul Stretch din giftbox! ))", GetName(playerid));
                        SendClientMessageToAll(COLOR_CLIENT, string);
                        format(string, sizeof(string), "(( AdmBot: Mai sunt %d vehicule disponibile. ))", 60-GiftVehicle);
                        SendClientMessageToAll(COLOR_CLIENT, string);
                        format(string, sizeof(string), "%s a castigat un Stretch din giftbox.", GetName(playerid));
                        InsertLog(playerid, string, LOG_GIFTBOX);                    
                    }
                }                                
            }
            else if(rand > 300 && rand < 305)
            {
                new str[128];
                PlayerInfo[playerid][pCarLic] = 1;
                PlayerInfo[playerid][pCarLicT] += 250;
                PlayerInfo[playerid][pCarLicS] = 0;
                PlayerInfo[playerid][pFlyLic] = 1;
                PlayerInfo[playerid][pFlyLicT] += 250;
                PlayerInfo[playerid][pFlyLicS] = 0;
                PlayerInfo[playerid][pBoatLic] = 1;
                PlayerInfo[playerid][pBoatLicT] += 250;
                PlayerInfo[playerid][pBoatLicS] = 0;
                PlayerInfo[playerid][pGunLic] = 1;
                PlayerInfo[playerid][pGunLicT] += 250;
                PlayerInfo[playerid][pGunLicS] = 0;        
                format(str,128,"UPDATE users SET `CarLic`='1',`CarLicT`='%d',`CarLicS`='0' WHERE `ID`='%d'",PlayerInfo[playerid][pCarLicT],PlayerInfo[playerid][pSQLID]);
                mysql_query(SQL,str);
                format(str,128,"UPDATE users SET `FlyLic`='1',`FlyLicT`='%d',`FlyLicS`='0' WHERE `ID`='%d'",PlayerInfo[playerid][pFlyLicT],PlayerInfo[playerid][pSQLID]);
                mysql_query(SQL,str);
                format(str,128,"UPDATE users SET `BoatLic`='1',`BoatLicT`='%d',`BoatLicS`='0' WHERE `ID`='%d'",PlayerInfo[playerid][pBoatLicT],PlayerInfo[playerid][pSQLID]);
                mysql_query(SQL,str);
                format(str,128,"UPDATE users SET `GunLic`='1',`GunLicT`='%d', `GunLicS`='0' WHERE `ID`='%d'",PlayerInfo[playerid][pGunLicT],PlayerInfo[playerid][pSQLID]);
                mysql_query(SQL,str);
                format(won, sizeof(won), "Ai primit toate licentele pentru inca 250 de ore!");
                format(string, sizeof(string), "%s a primit toate licentele pentru inca 250 de ore.", GetName(playerid));
                InsertLog(playerid, string, LOG_GIFTBOX);    
                ProxDetector(30.0,playerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);    
            }
            else if(rand > 305 && rand < 306) {
                if(PlayerInfo[playerid][pFpunish] == 0) {
                    new randmoney = 1000000 + random(4500000);
                    PlayerInfo[playerid][pCash] += randmoney;
                    GivePlayerCash(playerid, randmoney);
                    format(won, sizeof(won), "Ai castigat $%s din gift box!", FormatNumber(randmoney));
                    format(string, sizeof(string), "%s a castigat $%s din giftbox.", GetName(playerid), FormatNumber(randmoney));
                    InsertLog(playerid, string, LOG_GIFTBOX);
                    ProxDetector(30.0,playerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);    
                    GiftMoney += randmoney;                
                }
                else {
                    PlayerInfo[playerid][pFpunish] = 0;
                    Update(playerid, pFpunishx);
                    format(won, sizeof(won), "Felicitari! Ai ramas fara FP-uri.");
                    format(string, sizeof(string), "%s a ramas fara FP-uri.", GetName(playerid));
                    InsertLog(playerid, string, LOG_GIFTBOX);
                    ProxDetector(30.0,playerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);        
                }
            }                
            else if(rand > 306) {
                if(PlayerInfo[playerid][pWarns] == 0) {
                    new randmoney = 1000000 + random(4500000);
                    PlayerInfo[playerid][pCash] += randmoney;
                    GivePlayerCash(playerid, randmoney);
                    format(won, sizeof(won), "Ai castigat $%s din gift box!", FormatNumber(randmoney));
                    format(string, sizeof(string), "%s a castigat $%s din giftbox.", GetName(playerid), FormatNumber(randmoney));
                    InsertLog(playerid, string, LOG_GIFTBOX);
                    ProxDetector(30.0,playerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);    
                    GiftMoney += randmoney;                
                }
                else {
                    PlayerInfo[playerid][pWarns] = 0;
                    Update(playerid, pWarnsx);
                    format(won, sizeof(won), "Felicitari! Ti-au fost sterse warn-urile.");
                    format(string, sizeof(string), "%s a ramas fara warn-uri.", GetName(playerid));
                    InsertLog(playerid, string, LOG_GIFTBOX);    
                    ProxDetector(30.0,playerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);        
                }
            }
            else {
                new randmoney = 1000000 + random(4500000);
                PlayerInfo[playerid][pCash] += randmoney;
                GivePlayerCash(playerid, randmoney);
                format(won, sizeof(won), "Ai castigat $%s din gift box!", FormatNumber(randmoney));
                format(string, sizeof(string), "%s a castigat $%s din giftbox.", GetName(playerid), FormatNumber(randmoney));
                InsertLog(playerid, string, LOG_GIFTBOX);
                ProxDetector(30.0,playerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);    
                GiftMoney += randmoney;            
            }
            UpdateGift();
            ShowPlayerDialog(playerid, 0, DIALOG_STYLE_MSGBOX, "Giftbox", won, "Ok", "");
        }
        else return SendClientMessage(playerid, COLOR_GREY, "Nu esti la loc-ul getgift-ului ,acesta se afla pe plaja Los Santos");
    }
    else {
        format(string, sizeof(string), "Poti lua acest cadou peste %d ore.", 2-PlayerInfo[playerid][pGiftPoints]);
        SendClientMessage(playerid, COLOR_YELLOW, string);
        SCM(playerid, COLOR_YELLOW, "Orele se contorizeaza doar in momentul in care ai jucat cel putin 30 minute pana la payday.");
    }
    return 1;
}

function UpdateGift() {
    if(SpecialWeek == 0) return 1;
    new string[500];
    format(string, sizeof(string), "Giftbox (/getgift)\nBani castigati: {FC6A6A}$%s{FFFFFF}\nRP-uri castigate: {FC6A6A}%s{FFFFFF}\nPuncte premium castigate: {FC6A6A}%s{FFFFFF}\nVehicule castigate: {FC6A6A}%s{FFFFFF}", FormatNumber(GiftMoney), FormatNumber(GiftRP), FormatNumber(GiftGold), FormatNumber(GiftVehicle));
    UpdateDynamic3DTextLabelText(GiftText, -1, string);
    new query[256];
    format(query, sizeof(query), "UPDATE `stuff` SET `GiftMoney`='%d', `GiftRP`='%d', `GiftGold`='%d', `GiftLevel`='%d', `GiftFP`='%d', `GiftVehicle`='%d'", GiftMoney, GiftRP, GiftGold, GiftLevel, GiftFP, GiftVehicle);
    mysql_tquery(SQL, query, "", "");
    return 1;
}

 

 

Aceasta este comanda,o sa va las aici cateva poze cu ce am in gm si variabile etc / Procesor YCMD /

 

https://imgur.com/a/SCJ7IwJ     =  variabile  = defineuri de ce aveti nevoie...

 

Hai sa trecem la ce vreu sa fac si nu stiu cum !!!

 

Vreu ca in comanda /stats sa apara GiftPoints  ... /200

Si sa zicem la 200/200 sa poti da getgift..

 

La mine in gamemode poti da de cate ori vrei si asta nu imi place.Ma puteti ajuta va rog frumos ?

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.