M1hai Posted January 18, 2017 Posted January 18, 2017 Salut, la giftbox cand se primesc bani apar doar primele doua cifre din suma. Oare trebuie sa maresc stringul? Quote
M1hai Posted January 19, 2017 Author Posted January 19, 2017 if(randm >= 0 && randm <= 30) { new randmoney = 100000 + random(100000); GetPlayerName(playerid, sendername, sizeof(sendername)); GivePlayerCash(playerid, randmoney); Update(playerid, pCashx); format(string,sizeof(string),"Giftbox: You win $%d from giftbox.",FormatNumber(randmoney)); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", string, "OK", ""); format(string4,sizeof(string4),"%s won $%d from giftbox.",sendername,FormatNumber(randmoney)); } Quote
CrImA Posted January 19, 2017 Posted January 19, 2017 Inlocuieste cu asta: format(string4,sizeof(string4),"%s won $%s from giftbox.",sendername,FormatNumber(randmoney)); Quote
M1hai Posted January 20, 2017 Author Posted January 20, 2017 Inlocuieste cu asta: format(string4,sizeof(string4),"%s won $%s from giftbox.",sendername,FormatNumber(randmoney)); Nu a mers. Quote
CrImA Posted January 20, 2017 Posted January 20, 2017 Credeam ca te prinzi singur nu am modificat la ambele string-uri. Uite: format(string,sizeof(string),"Giftbox: You win $%s from giftbox.",FormatNumber(randmoney)); format(string4,sizeof(string4),"%s won $%s from giftbox.",sendername,FormatNumber(randmoney)); Quote
M1hai Posted January 20, 2017 Author Posted January 20, 2017 Credeam ca te prinzi singur nu am modificat la ambele string-uri. Uite: format(string,sizeof(string),"Giftbox: You win $%s from giftbox.",FormatNumber(randmoney)); format(string4,sizeof(string4),"%s won $%s from giftbox.",sendername,FormatNumber(randmoney)); M-am prins, am modificat si eu. Tot nu merge. Quote
Roby Posted January 21, 2017 Posted January 21, 2017 CMD:getgift(playerid, params[]) { if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to login first."); if(GiftBoxActiv == 0) return SendClientMessage(playerid, COLOR_WHITE, "The giftbox is not active."); if(PlayerInfo[playerid][pConnectTime] < 2) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need 3 hours to use /getgift."); if(PlayerInfo[playerid][pGiftTime] > 0) { new string[128]; format(string,sizeof(string),"Mai poti folosi aceasta comanda peste %d ore.",PlayerInfo[playerid][pGiftTime]); SendClientMessage(playerid, COLOR_YELLOW, string); return 1; } if(PlayerInfo[playerid][pGiftBox] == 1) { if(IsPlayerInRangeOfPoint(playerid, 5.0, 834.2477,-2052.5186,12.8672)) { new randgift = random(150),string[256],sendername[30],string2[256],string4[256]; GetPlayerName(playerid,sendername,sizeof(sendername)); if(randgift >= 0 && randgift <= 29) { new randmats = 2000 + random(28000); PlayerInfo[playerid][pMats] += randmats; Update(playerid, pMatsx); format(string,sizeof(string),"Giftbox: Ai castigat %d materiale din giftbox",randmats); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", string, "OK", ""); format(string4,sizeof(string4),"%s won %d Materials from giftbox.",sendername, randmats); } if(randgift >= 31 && randgift <= 59) { new str[1400]; PlayerInfo[playerid][pCarLic] = 1; PlayerInfo[playerid][pCarLicT] = 500; PlayerInfo[playerid][pFlyLic] = 1; PlayerInfo[playerid][pFlyLicT] = 500; PlayerInfo[playerid][pBoatLic] = 1; PlayerInfo[playerid][pBoatLicT] = 500; PlayerInfo[playerid][pGunLic] = 1; PlayerInfo[playerid][pGunLicT] = 500; mysql_format(SQL,str,1400,"UPDATE users SET `CarLic`='1',`CarLicT`='500',`FlyLic`='1',`FlyLicT`='500',`BoatLic`='1',`BoatLicT`='500',`GunLic`='1',`GunLicT`='500' WHERE `name`='%s'",PlayerInfo[playerid][pNormalName]); mysql_tquery(SQL,str,"",""); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", "Ai primit toate licentele pentru 500 ore.", "OK", ""); format(string2,sizeof(string),"(( Giftbox: %s a castigat toate licentele pentru 500 ore din giftbox! Felicitari! ))",sendername); } if(randgift >= 61 && randgift <= 89) { new randfw = 5 + random(20),str2[256]; PlayerInfo[playerid][pFWorks] += randfw; mysql_format(SQL,str2,sizeof(str2),"UPDATE users SET `FWorks`='%d' WHERE `name`='%s'",PlayerInfo[playerid][pFWorks],PlayerInfo[playerid][pNormalName]); mysql_tquery(SQL,str2,"",""); format(string,sizeof(string),"Giftbox: Ai castigat %d artificii.",randfw); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", string, "OK", ""); format(string4,sizeof(string4),"%s won %d Fireworks from giftbox.",sendername,randfw); } if(randgift >= 91 && randgift <= 109) { new randm = random(100); if(randm >= 0 && randm <= 30) { new randmoney = 100000 + random(100000); GivePlayerCash(playerid, randmoney); Update(playerid, pCashx); format(string,sizeof(string),"Giftbox: You win $%s from giftbox.",FormatNumber(randmoney)); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", string, "OK", ""); format(string4,sizeof(string4),"%s won $%s from giftbox.",sendername,FormatNumber(randmoney)); } if(randm >= 31 && randm <= 50) { new randmoney = 300000 + random(200000); GivePlayerCash(playerid, randmoney); Update(playerid, pCashx); format(string,sizeof(string),"Giftbox: You win $%s from giftbox.",FormatNumber(randmoney)); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", string, "OK", ""); format(string4,sizeof(string4),"%s won $%s from giftbox.",sendername,FormatNumber(randmoney)); } if(randm >= 51 && randm <= 80) { new randmoney = 500000 + random(500000); GivePlayerCash(playerid, randmoney); Update(playerid, pCashx); format(string,sizeof(string),"Giftbox: You win $%s from giftbox.",FormatNumber(randmoney)); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", string, "OK", ""); format(string4,sizeof(string4),"%s won $s from giftbox.",sendername,FormatNumber(randmoney)); } if(randm >= 81 && randm <= 90) { new randmoney = 1000000 + random(500000); GivePlayerCash(playerid, randmoney); Update(playerid, pCashx); format(string,sizeof(string),"Giftbox: You win $%s from giftbox.",FormatNumber(randmoney)); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", string, "OK", ""); format(string4,sizeof(string4),"%s won $%s from giftbox.",sendername,FormatNumber(randmoney)); } if(randm >= 91) { new randmoney = 2000000 + random(1000000); GivePlayerCash(playerid, randmoney); Update(playerid, pCashx); format(string,sizeof(string),"Giftbox: You win $%s from giftbox.",FormatNumber(randmoney)); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", string, "OK", ""); format(string4,sizeof(string4),"%s won $%s from giftbox.",sendername,FormatNumber(randmoney)); } } if(randgift >= 111 && randgift <= 119) { new randmoney = 1000000 + random(1000000); GivePlayerCash(playerid, randmoney); Update(playerid, pCashx); format(string,sizeof(string),"Giftbox: You win $%s from giftbox.",FormatNumber(randmoney)); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", string, "OK", ""); format(string4,sizeof(string4),"%s won $%s from giftbox.",sendername,FormatNumber(randmoney)); } if(randgift >= 120 && randgift <= 129) { if(PlayerInfo[playerid][pWarns] == 0) { new randmoney = 1000000 + random(1000000); GivePlayerCash(playerid, randmoney); Update(playerid, pCashx); format(string,sizeof(string),"Giftbox: You win $%s from giftbox.",FormatNumber(randmoney)); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", string, "OK", ""); format(string4,sizeof(string4),"%s won $%s from giftbox.",sendername,FormatNumber(randmoney)); } else { PlayerInfo[playerid][pWarns] = 0; Update(playerid, pWarnsx); format(string,sizeof(string),"Giftbox: You win Clear Warns from giftbox"); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", string, "OK", ""); format(string4,sizeof(string4),"%s won Clear Warns from giftbox."); } } if(randgift >= 130 && randgift <= 139) { if(PlayerInfo[playerid][pFpunish] == 0) { new randmoney = 1000000 + random(1000000); GivePlayerCash(playerid, randmoney); Update(playerid, pCashx); format(string,sizeof(string),"Giftbox: You win $%s from giftbox.",FormatNumber(randmoney)); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", string, "OK", ""); format(string4,sizeof(string4),"%s won $%s from giftbox.",sendername,FormatNumber(randmoney)); } else { PlayerInfo[playerid][pFpunish] = 0; Update(playerid,pFpunishx); format(string,sizeof(string),"Giftbx: You win Clear FP from giftbox."); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", string, "OK", ""); format(string4,sizeof(string4),"%s won Clear FP from giftbox."); } } if(randgift >= 141) { PlayerInfo[playerid][pHiddenColor] += 1; Update(playerid, pHiddenColorx); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", "Ai primit o culoare hidden.", "OK", ""); format(string2,sizeof(string),"(( Giftbox: %s a castigat o culoare hidden din giftbox! Felicitari! ))",sendername); } if(randgift == 30 || randgift == 60 || randgift == 90 || randgift == 110 || randgift == 140) { if(PremiumMaxim > 0) { new randpoints = 5 + random(25); PlayerInfo[playerid][pPremiumPoints] += randpoints; Update(playerid, pPremiumPointsx); PlayerInfo[playerid][pTotalPP] += randpoints; Update(playerid, pTotalPPx); if(PlayerInfo[playerid][pTotalPP] >= 200 && PlayerInfo[playerid][pVIP] == 0) { SCM(playerid, COLOR_ORANGE, "In contul tau s-au acumulat un total de 200 PP iar acum esti un VIP User."); PlayerInfo[playerid][pVIP] = 1; Update(playerid, pVIPx); } PremiumMaxim -= 1; format(string,sizeof(string),"Giftbox: You win %d premium points from giftbox.",randpoints); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", string, "OK", ""); format(string2,sizeof(string),"(( Giftbox: %s a castigat %d puncte premium din giftbox! Felicitari! ))",sendername, randpoints); } else { new randmoney = 4000000 + random(1000000); GivePlayerCash(playerid, randmoney); Update(playerid, pCashx); format(string,sizeof(string),"Giftbox: You win $%s from giftbox.",FormatNumber(randmoney)); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", string, "OK", ""); format(string4,sizeof(string4),"%s won $%s from giftbox.",sendername,FormatNumber(randmoney)); } } if(randgift >= 142) { InsertPCar(playerid,522,Stock[10][vPrice],"NRG-500",1); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", "Giftbox: You won a bike (NRG-500) from giftbox!", "OK", ""); format(string2,sizeof(string),"(( Giftbox: %s a castigat motocicleta de tip NRG-500! Felicitari! ))",sendername); } new y,m,d,h,mi,s; getdate(y,m,d); gettime(h,mi,s); PlayerInfo[playerid][pGiftTime] += 3; ProxDetector(30.0, playerid, string4, COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW); SendClientMessageToAll(COLOR_GENANNOUNCE,string2); Update(playerid, pGiftTimex); mysql_format(SQL, string, sizeof(string), "INSERT INTO giftbox_logs (`text`,`PlayerID`,`time`) VALUES ('%s','%d','%02d/%02d/%d %02d:%02d:%02d')", string, PlayerInfo[playerid][pSQLID],d,m,y,h,mi,s); mysql_tquery(SQL,string,"",""); } else { SendClientMessage(playerid, COLOR_WHITE, "Nu esti langa un giftbox."); SendClientMessage(playerid, COLOR_YELLOW, "Iti poti luat cadoul urmarind checkpoint-ul!"); SetPlayerCheckpoint(playerid, 834.2477,-2052.5186,12.8672, 5.0); CP[playerid] = 43; return 1; } } else if(PlayerInfo[playerid][pGiftBox] == 2) // asa faci si la giftbox 2/3/4 { if(IsPlayerInRangeOfPoint(playerid, 5.0, 2869.4817,-1589.1746,22.4913)) { new randgift = random(150),string[256],sendername[30],string2[256],string4[256]; GetPlayerName(playerid,sendername,sizeof(sendername)); if(randgift >= 0 && randgift <= 29) { new randmats = 2000 + random(28000); PlayerInfo[playerid][pMats] += randmats; Update(playerid, pMatsx); format(string,sizeof(string),"Giftbox: Ai castigat %d materiale din giftbox",randmats); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", string, "OK", ""); format(string4,sizeof(string4),"%s won %d Materials from giftbox.", sendername,randmats); } if(randgift >= 31 && randgift <= 59) { new str[1400]; PlayerInfo[playerid][pCarLic] = 1; PlayerInfo[playerid][pCarLicT] = 500; PlayerInfo[playerid][pFlyLic] = 1; PlayerInfo[playerid][pFlyLicT] = 500; PlayerInfo[playerid][pBoatLic] = 1; PlayerInfo[playerid][pBoatLicT] = 500; PlayerInfo[playerid][pGunLic] = 1; PlayerInfo[playerid][pGunLicT] = 500; mysql_format(SQL,str,1400,"UPDATE users SET `CarLic`='1',`CarLicT`='500',`FlyLic`='1',`FlyLicT`='500',`BoatLic`='1',`BoatLicT`='500',`GunLic`='1',`GunLicT`='500' WHERE `name`='%s'",PlayerInfo[playerid][pNormalName]); mysql_tquery(SQL,str,"",""); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", "Ai primit toate licentele pentru 500 ore.", "OK", ""); format(string2,sizeof(string),"(( Giftbox: %s a castigat toate licentele pentru 500 ore din giftbox! Felicitari! ))",sendername); } if(randgift >= 61 && randgift <= 89) { new randfw = 5 + random(20),str2[256]; PlayerInfo[playerid][pFWorks] += randfw; mysql_format(SQL,str2,sizeof(str2),"UPDATE users SET `FWorks`='%d' WHERE `name`='%s'",PlayerInfo[playerid][pFWorks],PlayerInfo[playerid][pNormalName]); mysql_tquery(SQL,str2,"",""); format(string,sizeof(string),"Giftbox: Ai castigat %d artificii.",randfw); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", string, "OK", ""); format(string4,sizeof(string4),"%s won %d Fireworks from giftbox.",sendername,randfw); } if(randgift >= 91 && randgift <= 109) { new randm = random(100); if(randm >= 0 && randm <= 30) { new randmoney = 100000 + random(100000); GivePlayerCash(playerid, randmoney); Update(playerid, pCashx); format(string,sizeof(string),"Giftbox: You win $%s from giftbox.",FormatNumber(randmoney)); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", string, "OK", ""); format(string4,sizeof(string4),"%s won $%s from giftbox.",sendername,FormatNumber(randmoney)); } if(randm >= 31 && randm <= 50) { new randmoney = 300000 + random(200000); GivePlayerCash(playerid, randmoney); Update(playerid, pCashx); format(string,sizeof(string),"Giftbox: You win $%s from giftbox.",FormatNumber(randmoney)); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", string, "OK", ""); format(string4,sizeof(string4),"%s won $%s from giftbox.",sendername,FormatNumber(randmoney)); } if(randm >= 51 && randm <= 80) { new randmoney = 500000 + random(500000); GivePlayerCash(playerid, randmoney); Update(playerid, pCashx); format(string,sizeof(string),"Giftbox: You win $%s from giftbox.",FormatNumber(randmoney)); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", string, "OK", ""); format(string4,sizeof(string4),"%s won $%s from giftbox.",sendername,FormatNumber(randmoney)); } if(randm >= 81 && randm <= 90) { new randmoney = 1000000 + random(500000); GivePlayerCash(playerid, randmoney); Update(playerid, pCashx); format(string,sizeof(string),"Giftbox: You win $%s from giftbox.",FormatNumber(randmoney)); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", string, "OK", ""); format(string4,sizeof(string4),"%s won $%s from giftbox.",sendername,FormatNumber(randmoney)); } if(randm >= 91) { new randmoney = 2000000 + random(1000000); GivePlayerCash(playerid, randmoney); Update(playerid, pCashx); format(string,sizeof(string),"Giftbox: You win $%s from giftbox.",FormatNumber(randmoney)); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", string, "OK", ""); format(string4,sizeof(string4),"%s won $%s from giftbox.",sendername,FormatNumber(randmoney)); } } if(randgift >= 111 && randgift <= 119) { new randmoney = 1000000 + random(1000000); GivePlayerCash(playerid, randmoney); Update(playerid, pCashx); format(string,sizeof(string),"Giftbox: You win $%s from giftbox.",FormatNumber(randmoney)); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", string, "OK", ""); format(string4,sizeof(string4),"%s won $%s from giftbox.",sendername,FormatNumber(randmoney)); } if(randgift >= 120 && randgift <= 129) { if(PlayerInfo[playerid][pWarns] == 0) { new randmoney = 1000000 + random(1000000); GivePlayerCash(playerid, randmoney); Update(playerid, pCashx); format(string,sizeof(string),"Giftbox: You win $%s from giftbox.",FormatNumber(randmoney)); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", string, "OK", ""); format(string4,sizeof(string4),"%s won $%s from giftbox.",sendername,FormatNumber(randmoney)); } else { PlayerInfo[playerid][pWarns] = 0; Update(playerid, pWarnsx); format(string,sizeof(string),"Giftbox: You win Clear Warns from giftbox"); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", string, "OK", ""); format(string4,sizeof(string4),"%s won Clear Warns from giftbox."); } } if(randgift >= 130 && randgift <= 139) { if(PlayerInfo[playerid][pFpunish] == 0) { new randmoney = 1000000 + random(1000000); GivePlayerCash(playerid, randmoney); Update(playerid, pCashx); format(string,sizeof(string),"Giftbox: You win $%s from giftbox.",FormatNumber(randmoney)); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", string, "OK", ""); format(string4,sizeof(string4),"%s won $%s from giftbox.",sendername,FormatNumber(randmoney)); } else { PlayerInfo[playerid][pFpunish] = 0; Update(playerid,pFpunishx); format(string,sizeof(string),"Giftbx: You win Clear FP from giftbox."); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", string, "OK", ""); format(string4,sizeof(string4),"%s won Clear FP from giftbox."); } } if(randgift >= 141) { PlayerInfo[playerid][pHiddenColor] += 1; Update(playerid, pHiddenColorx); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", "Ai primit o culoare hidden.", "OK", ""); format(string2,sizeof(string),"(( Giftbox: %s a castigat o culoare hidden din giftbox! Felicitari! ))",sendername); } if(randgift == 30 || randgift == 60 || randgift == 90 || randgift == 110 || randgift == 140) { if(PremiumMaxim > 0) { new randpoints = 5 + random(62); PlayerInfo[playerid][pPremiumPoints] += randpoints; Update(playerid, pPremiumPointsx); PlayerInfo[playerid][pTotalPP] += randpoints; Update(playerid, pTotalPPx); if(PlayerInfo[playerid][pTotalPP] >= 200 && PlayerInfo[playerid][pVIP] == 0) { SCM(playerid, COLOR_ORANGE, "In contul tau s-au acumulat un total de 200 PP iar acum esti un VIP User."); PlayerInfo[playerid][pVIP] = 1; Update(playerid, pVIPx); } PremiumMaxim -= 1; format(string,sizeof(string),"Giftbox: You win %d premium points from giftbox.",randpoints); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", string, "OK", ""); format(string2,sizeof(string),"(( Giftbox: %s a castigat %d puncte premium din giftbox! Felicitari! ))",sendername, randpoints); } else { new randmoney = 4000000 + random(1000000); GivePlayerCash(playerid, randmoney); Update(playerid, pCashx); format(string,sizeof(string),"Giftbox: You win $%s from giftbox.",FormatNumber(randmoney)); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", string, "OK", ""); format(string4,sizeof(string4),"%s won $%s from giftbox.",sendername,FormatNumber(randmoney)); } } if(randgift >= 142) { InsertPCar(playerid,522,Stock[10][vPrice],"NRG-500",1); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", "Giftbox: You won a bike (NRG-500) from giftbox!", "OK", ""); format(string2,sizeof(string),"(( Giftbox: %s a castigat motocicleta de tip NRG-500! Felicitari! ))",sendername); } new y,m,d,h,mi,s; getdate(y,m,d); gettime(h,mi,s); PlayerInfo[playerid][pGiftTime] += 3; ProxDetector(30.0, playerid, string4, COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW); SendClientMessageToAll(COLOR_GENANNOUNCE,string2); Update(playerid, pGiftTimex); mysql_format(SQL, string, sizeof(string), "INSERT INTO giftbox_logs (`text`,`PlayerID`,`time`) VALUES ('%s','%d','%02d/%02d/%d %02d:%02d:%02d')", string, PlayerInfo[playerid][pSQLID],d,m,y,h,mi,s); mysql_tquery(SQL,string,"",""); } else { SendClientMessage(playerid, COLOR_WHITE, "Nu esti langa un giftbox."); SendClientMessage(playerid, COLOR_YELLOW, "Iti poti luat cadoul urmarind checkpoint-ul!"); SetPlayerCheckpoint(playerid, 2869.4817,-1589.1746,22.4913, 5.0); CP[playerid] = 43; return 1; } } else if(PlayerInfo[playerid][pGiftBox] == 3) // asa faci si la giftbox 2/3/4 { if(IsPlayerInRangeOfPoint(playerid, 5.0, 1879.8340,1977.6876,13.7848)) { new randgift = random(150),string[256],sendername[30],string2[256],string4[256]; GetPlayerName(playerid,sendername,sizeof(sendername)); if(randgift >= 0 && randgift <= 29) { new randmats = 2000 + random(28000); PlayerInfo[playerid][pMats] += randmats; Update(playerid, pMatsx); format(string,sizeof(string),"Giftbox: Ai castigat %d materiale din giftbox",randmats); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", string, "OK", ""); format(string4,sizeof(string4),"%s won %d Materials from giftbox.",sendername, randmats); } if(randgift >= 31 && randgift <= 59) { new str[1400]; PlayerInfo[playerid][pCarLic] = 1; PlayerInfo[playerid][pCarLicT] = 500; PlayerInfo[playerid][pFlyLic] = 1; PlayerInfo[playerid][pFlyLicT] = 500; PlayerInfo[playerid][pBoatLic] = 1; PlayerInfo[playerid][pBoatLicT] = 500; PlayerInfo[playerid][pGunLic] = 1; PlayerInfo[playerid][pGunLicT] = 500; mysql_format(SQL,str,1400,"UPDATE users SET `CarLic`='1',`CarLicT`='500',`FlyLic`='1',`FlyLicT`='500',`BoatLic`='1',`BoatLicT`='500',`GunLic`='1',`GunLicT`='500' WHERE `name`='%s'",PlayerInfo[playerid][pNormalName]); mysql_tquery(SQL,str,"",""); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", "Ai primit toate licentele pentru 500 ore.", "OK", ""); format(string2,sizeof(string),"(( Giftbox: %s a castigat toate licentele pentru 500 ore din giftbox! Felicitari! ))",sendername); } if(randgift >= 61 && randgift <= 89) { new randfw = 5 + random(20),str2[256]; PlayerInfo[playerid][pFWorks] += randfw; mysql_format(SQL,str2,sizeof(str2),"UPDATE users SET `FWorks`='%d' WHERE `name`='%s'",PlayerInfo[playerid][pFWorks],PlayerInfo[playerid][pNormalName]); mysql_tquery(SQL,str2,"",""); format(string,sizeof(string),"Giftbox: Ai castigat %d artificii.",randfw); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", string, "OK", ""); format(string4,sizeof(string4),"%s won %d Fireworks from giftbox.",sendername,randfw); } if(randgift >= 91 && randgift <= 109) { new randm = random(100); if(randm >= 0 && randm <= 30) { new randmoney = 100000 + random(100000); GivePlayerCash(playerid, randmoney); Update(playerid, pCashx); format(string,sizeof(string),"Giftbox: You win $%s from giftbox.",FormatNumber(randmoney)); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", string, "OK", ""); format(string4,sizeof(string4),"%s won $%s from giftbox.",sendername,FormatNumber(randmoney)); } if(randm >= 31 && randm <= 50) { new randmoney = 300000 + random(200000); GivePlayerCash(playerid, randmoney); Update(playerid, pCashx); format(string,sizeof(string),"Giftbox: You win $%s from giftbox.",FormatNumber(randmoney)); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", string, "OK", ""); format(string4,sizeof(string4),"%s won $%s from giftbox.",sendername,FormatNumber(randmoney)); } if(randm >= 51 && randm <= 80) { new randmoney = 500000 + random(500000); GivePlayerCash(playerid, randmoney); Update(playerid, pCashx); format(string,sizeof(string),"Giftbox: You win $%s from giftbox.",FormatNumber(randmoney)); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", string, "OK", ""); format(string4,sizeof(string4),"%s won $%s from giftbox.",sendername,FormatNumber(randmoney)); } if(randm >= 81 && randm <= 90) { new randmoney = 1000000 + random(500000); GivePlayerCash(playerid, randmoney); Update(playerid, pCashx); format(string,sizeof(string),"Giftbox: You win $%s from giftbox.",FormatNumber(randmoney)); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", string, "OK", ""); format(string4,sizeof(string4),"%s won $%s from giftbox.",sendername,FormatNumber(randmoney)); } if(randm >= 91) { new randmoney = 2000000 + random(1000000); GivePlayerCash(playerid, randmoney); Update(playerid, pCashx); format(string,sizeof(string),"Giftbox: You win $%s from giftbox.",FormatNumber(randmoney)); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", string, "OK", ""); format(string4,sizeof(string4),"%s won $%s from giftbox.",sendername,FormatNumber(randmoney)); } } if(randgift >= 111 && randgift <= 119) { new randmoney = 1000000 + random(1000000); GivePlayerCash(playerid, randmoney); Update(playerid, pCashx); format(string,sizeof(string),"Giftbox: You win $%s from giftbox.",FormatNumber(randmoney)); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", string, "OK", ""); format(string4,sizeof(string4),"%s won $%s from giftbox.",sendername,FormatNumber(randmoney)); } if(randgift >= 120 && randgift <= 129) { if(PlayerInfo[playerid][pWarns] == 0) { new randmoney = 1000000 + random(1000000); GivePlayerCash(playerid, randmoney); Update(playerid, pCashx); format(string,sizeof(string),"Giftbox: You win $%s from giftbox.",FormatNumber(randmoney)); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", string, "OK", ""); format(string4,sizeof(string4),"%s won $%s from giftbox.",sendername,FormatNumber(randmoney)); } else { PlayerInfo[playerid][pWarns] = 0; Update(playerid, pWarnsx); format(string,sizeof(string),"Giftbox: You win Clear Warns from giftbox"); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", string, "OK", ""); format(string4,sizeof(string4),"%s won Clear Warns from giftbox."); } } if(randgift >= 130 && randgift <= 139) { if(PlayerInfo[playerid][pFpunish] == 0) { new randmoney = 1000000 + random(1000000); GivePlayerCash(playerid, randmoney); Update(playerid, pCashx); format(string,sizeof(string),"Giftbox: You win $%s from giftbox.",FormatNumber(randmoney)); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", string, "OK", ""); format(string4,sizeof(string4),"%s won $%s from giftbox.",sendername,FormatNumber(randmoney)); } else { PlayerInfo[playerid][pFpunish] = 0; Update(playerid,pFpunishx); format(string,sizeof(string),"Giftbx: You win Clear FP from giftbox."); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", string, "OK", ""); format(string4,sizeof(string4),"%s won Clear FP from giftbox."); } } if(randgift >= 141) { PlayerInfo[playerid][pHiddenColor] += 1; Update(playerid, pHiddenColorx); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", "Ai primit o culoare hidden.", "OK", ""); format(string2,sizeof(string),"(( Giftbox: %s a castigat o culoare hidden din giftbox! Felicitari! ))",sendername); } if(randgift == 30 || randgift == 60 || randgift == 90 || randgift == 110 || randgift == 140) { if(PremiumMaxim > 0) { new randpoints = 5 + random(62); PlayerInfo[playerid][pPremiumPoints] += randpoints; Update(playerid, pPremiumPointsx); PlayerInfo[playerid][pTotalPP] += randpoints; Update(playerid, pTotalPPx); if(PlayerInfo[playerid][pTotalPP] >= 200 && PlayerInfo[playerid][pVIP] == 0) { SCM(playerid, COLOR_ORANGE, "In contul tau s-au acumulat un total de 200 PP iar acum esti un VIP User."); PlayerInfo[playerid][pVIP] = 1; Update(playerid, pVIPx); } PremiumMaxim -= 1; format(string,sizeof(string),"Giftbox: You win %d premium points from giftbox.",randpoints); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", string, "OK", ""); format(string2,sizeof(string),"(( Giftbox: %s a castigat %d puncte premium din giftbox! Felicitari! ))",sendername, randpoints); } else { new randmoney = 4000000 + random(1000000); GivePlayerCash(playerid, randmoney); Update(playerid, pCashx); format(string,sizeof(string),"Giftbox: You win $%s from giftbox.",FormatNumber(randmoney)); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", string, "OK", ""); format(string4,sizeof(string4),"%s won $%s from giftbox.",sendername,FormatNumber(randmoney)); } } if(randgift >= 142) { InsertPCar(playerid,522,Stock[10][vPrice],"NRG-500",1); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", "Giftbox: You won a bike (NRG-500) from giftbox!", "OK", ""); format(string2,sizeof(string),"(( Giftbox: %s a castigat motocicleta de tip NRG-500! Felicitari! ))",sendername); } new y,m,d,h,mi,s; getdate(y,m,d); gettime(h,mi,s); PlayerInfo[playerid][pGiftTime] += 3; ProxDetector(30.0, playerid, string4, COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW); SendClientMessageToAll(COLOR_GENANNOUNCE,string2); Update(playerid, pGiftTimex); mysql_format(SQL, string, sizeof(string), "INSERT INTO giftbox_logs (`text`,`PlayerID`,`time`) VALUES ('%s','%d','%02d/%02d/%d %02d:%02d:%02d')", string, PlayerInfo[playerid][pSQLID],d,m,y,h,mi,s); mysql_tquery(SQL,string,"",""); } else { SendClientMessage(playerid, COLOR_WHITE, "Nu esti langa un giftbox."); SendClientMessage(playerid, COLOR_YELLOW, "Iti poti luat cadoul urmarind checkpoint-ul!"); SetPlayerCheckpoint(playerid, 1879.8340,1977.6876,13.7848, 5.0); CP[playerid] = 43; return 1; } } else if(PlayerInfo[playerid][pGiftBox] == 4) // asa faci si la giftbox 2/3/4 { if(IsPlayerInRangeOfPoint(playerid, 5.0, -791.5663,1436.9779,13.78913)) { new randgift = random(150),string[256],sendername[30],string2[256],string4[256]; GetPlayerName(playerid,sendername,sizeof(sendername)); if(randgift >= 0 && randgift <= 29) { new randmats = 2000 + random(28000); PlayerInfo[playerid][pMats] += randmats; Update(playerid, pMatsx); format(string,sizeof(string),"Giftbox: Ai castigat %d materiale din giftbox",randmats); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", string, "OK", ""); format(string4,sizeof(string4),"%s won %d Materials from giftbox.", sendername,randmats); } if(randgift >= 31 && randgift <= 59) { new str[1400]; PlayerInfo[playerid][pCarLic] = 1; PlayerInfo[playerid][pCarLicT] = 500; PlayerInfo[playerid][pFlyLic] = 1; PlayerInfo[playerid][pFlyLicT] = 500; PlayerInfo[playerid][pBoatLic] = 1; PlayerInfo[playerid][pBoatLicT] = 500; PlayerInfo[playerid][pGunLic] = 1; PlayerInfo[playerid][pGunLicT] = 500; mysql_format(SQL,str,1400,"UPDATE users SET `CarLic`='1',`CarLicT`='500',`FlyLic`='1',`FlyLicT`='500',`BoatLic`='1',`BoatLicT`='500',`GunLic`='1',`GunLicT`='500' WHERE `name`='%s'",PlayerInfo[playerid][pNormalName]); mysql_tquery(SQL,str,"",""); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", "Ai primit toate licentele pentru 500 ore.", "OK", ""); format(string2,sizeof(string),"(( Giftbox: %s a castigat toate licentele pentru 500 ore din giftbox! Felicitari! ))",sendername); } if(randgift >= 61 && randgift <= 89) { new randfw = 5 + random(20),str2[256]; PlayerInfo[playerid][pFWorks] += randfw; mysql_format(SQL,str2,sizeof(str2),"UPDATE users SET `FWorks`='%d' WHERE `name`='%s'",PlayerInfo[playerid][pFWorks],PlayerInfo[playerid][pNormalName]); mysql_tquery(SQL,str2,"",""); format(string,sizeof(string),"Giftbox: Ai castigat %d artificii.",randfw); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", string, "OK", ""); format(string4,sizeof(string4),"%s won %d Fireworks from giftbox.",sendername,randfw); } if(randgift >= 91 && randgift <= 109) { new randm = random(100); if(randm >= 0 && randm <= 30) { new randmoney = 100000 + random(100000); GivePlayerCash(playerid, randmoney); Update(playerid, pCashx); format(string,sizeof(string),"Giftbox: You win $%s from giftbox.",FormatNumber(randmoney)); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", string, "OK", ""); format(string4,sizeof(string4),"%s won $%s from giftbox.",sendername,FormatNumber(randmoney)); } if(randm >= 31 && randm <= 50) { new randmoney = 300000 + random(200000); GivePlayerCash(playerid, randmoney); Update(playerid, pCashx); format(string,sizeof(string),"Giftbox: You win $%s from giftbox.",FormatNumber(randmoney)); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", string, "OK", ""); format(string4,sizeof(string4),"%s won $%s from giftbox.",sendername,FormatNumber(randmoney)); } if(randm >= 51 && randm <= 80) { new randmoney = 500000 + random(500000); GivePlayerCash(playerid, randmoney); Update(playerid, pCashx); format(string,sizeof(string),"Giftbox: You win $%s from giftbox.",FormatNumber(randmoney)); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", string, "OK", ""); format(string4,sizeof(string4),"%s won $%s from giftbox.",sendername,FormatNumber(randmoney)); } if(randm >= 81 && randm <= 90) { new randmoney = 1000000 + random(500000); GivePlayerCash(playerid, randmoney); Update(playerid, pCashx); format(string,sizeof(string),"Giftbox: You win $%s from giftbox.",FormatNumber(randmoney)); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", string, "OK", ""); format(string4,sizeof(string4),"%s won $%s from giftbox.",sendername,FormatNumber(randmoney)); } if(randm >= 91) { new randmoney = 2000000 + random(1000000); GivePlayerCash(playerid, randmoney); Update(playerid, pCashx); format(string,sizeof(string),"Giftbox: You win $%s from giftbox.",FormatNumber(randmoney)); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", string, "OK", ""); format(string4,sizeof(string4),"%s won $%s from giftbox.",sendername,FormatNumber(randmoney)); } } if(randgift >= 111 && randgift <= 119) { new randmoney = 1000000 + random(1000000); GivePlayerCash(playerid, randmoney); Update(playerid, pCashx); format(string,sizeof(string),"Giftbox: You win $%s from giftbox.",FormatNumber(randmoney)); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", string, "OK", ""); format(string4,sizeof(string4),"%s won $%s from giftbox.",sendername,FormatNumber(randmoney)); } if(randgift >= 120 && randgift <= 129) { if(PlayerInfo[playerid][pWarns] == 0) { new randmoney = 1000000 + random(1000000); GivePlayerCash(playerid, randmoney); Update(playerid, pCashx); format(string,sizeof(string),"Giftbox: You win $%s from giftbox.",FormatNumber(randmoney)); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", string, "OK", ""); format(string4,sizeof(string4),"%s won $%s from giftbox.",sendername,FormatNumber(randmoney)); } else { PlayerInfo[playerid][pWarns] = 0; Update(playerid, pWarnsx); format(string,sizeof(string),"Giftbox: You win Clear Warns from giftbox"); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", string, "OK", ""); format(string4,sizeof(string4),"%s won Clear Warns from giftbox."); } } if(randgift >= 130 && randgift <= 139) { if(PlayerInfo[playerid][pFpunish] == 0) { new randmoney = 1000000 + random(1000000); GivePlayerCash(playerid, randmoney); Update(playerid, pCashx); format(string,sizeof(string),"Giftbox: You win $%s from giftbox.",FormatNumber(randmoney)); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", string, "OK", ""); format(string4,sizeof(string4),"%s won $%s from giftbox.",sendername,FormatNumber(randmoney)); } else { PlayerInfo[playerid][pFpunish] = 0; Update(playerid,pFpunishx); format(string,sizeof(string),"Giftbx: You win Clear FP from giftbox."); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", string, "OK", ""); format(string4,sizeof(string4),"%s won Clear FP from giftbox."); } } if(randgift >= 141) { PlayerInfo[playerid][pHiddenColor] += 1; Update(playerid, pHiddenColorx); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", "Ai primit o culoare hidden.", "OK", ""); format(string2,sizeof(string),"(( Giftbox: %s a castigat o culoare hidden din giftbox! Felicitari! ))",sendername); } if(randgift == 30 || randgift == 60 || randgift == 90 || randgift == 110 || randgift == 140) { if(PremiumMaxim > 0) { new randpoints = 5 + random(62); PlayerInfo[playerid][pPremiumPoints] += randpoints; Update(playerid, pPremiumPointsx); PlayerInfo[playerid][pTotalPP] += randpoints; Update(playerid, pTotalPPx); if(PlayerInfo[playerid][pTotalPP] >= 200 && PlayerInfo[playerid][pVIP] == 0) { SCM(playerid, COLOR_ORANGE, "In contul tau s-au acumulat un total de 200 PP iar acum esti un VIP User."); PlayerInfo[playerid][pVIP] = 1; Update(playerid, pVIPx); } PremiumMaxim -= 1; format(string,sizeof(string),"Giftbox: You win %d premium points from giftbox.",randpoints); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", string, "OK", ""); format(string2,sizeof(string),"(( Giftbox: %s a castigat %d puncte premium din giftbox! Felicitari! ))",sendername, randpoints); } else { new randmoney = 4000000 + random(1000000); GivePlayerCash(playerid, randmoney); Update(playerid, pCashx); format(string,sizeof(string),"Giftbox: You win $%s from giftbox.",FormatNumber(randmoney)); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", string, "OK", ""); format(string4,sizeof(string4),"%s won $%s from giftbox.",sendername,FormatNumber(randmoney)); } } if(randgift >= 142) { InsertPCar(playerid,522,Stock[10][vPrice],"NRG-500",1); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", "Giftbox: You won a bike (NRG-500) from giftbox!", "OK", ""); format(string2,sizeof(string),"(( Giftbox: %s a castigat motocicleta de tip NRG-500! Felicitari! ))",sendername); } new y,m,d,h,mi,s; getdate(y,m,d); gettime(h,mi,s); PlayerInfo[playerid][pGiftTime] += 3; ProxDetector(30.0, playerid, string4, COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW); SendClientMessageToAll(COLOR_GENANNOUNCE,string2); Update(playerid, pGiftTimex); mysql_format(SQL, string, sizeof(string), "INSERT INTO giftbox_logs (`text`,`PlayerID`,`time`) VALUES ('%s','%d','%02d/%02d/%d %02d:%02d:%02d')", string, PlayerInfo[playerid][pSQLID],d,m,y,h,mi,s); mysql_tquery(SQL,string,"",""); } else { SendClientMessage(playerid, COLOR_WHITE, "Nu esti langa un giftbox."); SendClientMessage(playerid, COLOR_YELLOW, "Iti poti luat cadoul urmarind checkpoint-ul!"); SetPlayerCheckpoint(playerid, -791.5663,1436.9779,13.78913, 5.0); CP[playerid] = 43; return 1; } } return 1; } Nu stiu daca iti este compatibila, dar o poti incerca. Quote
M1hai Posted January 21, 2017 Author Posted January 21, 2017 CMD:getgift(playerid, params[]) { if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to login first."); if(GiftBoxActiv == 0) return SendClientMessage(playerid, COLOR_WHITE, "The giftbox is not active."); if(PlayerInfo[playerid][pConnectTime] < 2) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need 3 hours to use /getgift."); if(PlayerInfo[playerid][pGiftTime] > 0) { new string[128]; format(string,sizeof(string),"Mai poti folosi aceasta comanda peste %d ore.",PlayerInfo[playerid][pGiftTime]); SendClientMessage(playerid, COLOR_YELLOW, string); return 1; } if(PlayerInfo[playerid][pGiftBox] == 1) { if(IsPlayerInRangeOfPoint(playerid, 5.0, 834.2477,-2052.5186,12.8672)) { new randgift = random(150),string[256],sendername[30],string2[256],string4[256]; GetPlayerName(playerid,sendername,sizeof(sendername)); if(randgift >= 0 && randgift <= 29) { new randmats = 2000 + random(28000); PlayerInfo[playerid][pMats] += randmats; Update(playerid, pMatsx); format(string,sizeof(string),"Giftbox: Ai castigat %d materiale din giftbox",randmats); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", string, "OK", ""); format(string4,sizeof(string4),"%s won %d Materials from giftbox.",sendername, randmats); } if(randgift >= 31 && randgift <= 59) { new str[1400]; PlayerInfo[playerid][pCarLic] = 1; PlayerInfo[playerid][pCarLicT] = 500; PlayerInfo[playerid][pFlyLic] = 1; PlayerInfo[playerid][pFlyLicT] = 500; PlayerInfo[playerid][pBoatLic] = 1; PlayerInfo[playerid][pBoatLicT] = 500; PlayerInfo[playerid][pGunLic] = 1; PlayerInfo[playerid][pGunLicT] = 500; mysql_format(SQL,str,1400,"UPDATE users SET `CarLic`='1',`CarLicT`='500',`FlyLic`='1',`FlyLicT`='500',`BoatLic`='1',`BoatLicT`='500',`GunLic`='1',`GunLicT`='500' WHERE `name`='%s'",PlayerInfo[playerid][pNormalName]); mysql_tquery(SQL,str,"",""); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", "Ai primit toate licentele pentru 500 ore.", "OK", ""); format(string2,sizeof(string),"(( Giftbox: %s a castigat toate licentele pentru 500 ore din giftbox! Felicitari! ))",sendername); } if(randgift >= 61 && randgift <= 89) { new randfw = 5 + random(20),str2[256]; PlayerInfo[playerid][pFWorks] += randfw; mysql_format(SQL,str2,sizeof(str2),"UPDATE users SET `FWorks`='%d' WHERE `name`='%s'",PlayerInfo[playerid][pFWorks],PlayerInfo[playerid][pNormalName]); mysql_tquery(SQL,str2,"",""); format(string,sizeof(string),"Giftbox: Ai castigat %d artificii.",randfw); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", string, "OK", ""); format(string4,sizeof(string4),"%s won %d Fireworks from giftbox.",sendername,randfw); } if(randgift >= 91 && randgift <= 109) { new randm = random(100); if(randm >= 0 && randm <= 30) { new randmoney = 100000 + random(100000); GivePlayerCash(playerid, randmoney); Update(playerid, pCashx); format(string,sizeof(string),"Giftbox: You win $%s from giftbox.",FormatNumber(randmoney)); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", string, "OK", ""); format(string4,sizeof(string4),"%s won $%s from giftbox.",sendername,FormatNumber(randmoney)); } if(randm >= 31 && randm <= 50) { new randmoney = 300000 + random(200000); GivePlayerCash(playerid, randmoney); Update(playerid, pCashx); format(string,sizeof(string),"Giftbox: You win $%s from giftbox.",FormatNumber(randmoney)); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", string, "OK", ""); format(string4,sizeof(string4),"%s won $%s from giftbox.",sendername,FormatNumber(randmoney)); } if(randm >= 51 && randm <= 80) { new randmoney = 500000 + random(500000); GivePlayerCash(playerid, randmoney); Update(playerid, pCashx); format(string,sizeof(string),"Giftbox: You win $%s from giftbox.",FormatNumber(randmoney)); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", string, "OK", ""); format(string4,sizeof(string4),"%s won $s from giftbox.",sendername,FormatNumber(randmoney)); } if(randm >= 81 && randm <= 90) { new randmoney = 1000000 + random(500000); GivePlayerCash(playerid, randmoney); Update(playerid, pCashx); format(string,sizeof(string),"Giftbox: You win $%s from giftbox.",FormatNumber(randmoney)); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", string, "OK", ""); format(string4,sizeof(string4),"%s won $%s from giftbox.",sendername,FormatNumber(randmoney)); } if(randm >= 91) { new randmoney = 2000000 + random(1000000); GivePlayerCash(playerid, randmoney); Update(playerid, pCashx); format(string,sizeof(string),"Giftbox: You win $%s from giftbox.",FormatNumber(randmoney)); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", string, "OK", ""); format(string4,sizeof(string4),"%s won $%s from giftbox.",sendername,FormatNumber(randmoney)); } } if(randgift >= 111 && randgift <= 119) { new randmoney = 1000000 + random(1000000); GivePlayerCash(playerid, randmoney); Update(playerid, pCashx); format(string,sizeof(string),"Giftbox: You win $%s from giftbox.",FormatNumber(randmoney)); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", string, "OK", ""); format(string4,sizeof(string4),"%s won $%s from giftbox.",sendername,FormatNumber(randmoney)); } if(randgift >= 120 && randgift <= 129) { if(PlayerInfo[playerid][pWarns] == 0) { new randmoney = 1000000 + random(1000000); GivePlayerCash(playerid, randmoney); Update(playerid, pCashx); format(string,sizeof(string),"Giftbox: You win $%s from giftbox.",FormatNumber(randmoney)); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", string, "OK", ""); format(string4,sizeof(string4),"%s won $%s from giftbox.",sendername,FormatNumber(randmoney)); } else { PlayerInfo[playerid][pWarns] = 0; Update(playerid, pWarnsx); format(string,sizeof(string),"Giftbox: You win Clear Warns from giftbox"); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", string, "OK", ""); format(string4,sizeof(string4),"%s won Clear Warns from giftbox."); } } if(randgift >= 130 && randgift <= 139) { if(PlayerInfo[playerid][pFpunish] == 0) { new randmoney = 1000000 + random(1000000); GivePlayerCash(playerid, randmoney); Update(playerid, pCashx); format(string,sizeof(string),"Giftbox: You win $%s from giftbox.",FormatNumber(randmoney)); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", string, "OK", ""); format(string4,sizeof(string4),"%s won $%s from giftbox.",sendername,FormatNumber(randmoney)); } else { PlayerInfo[playerid][pFpunish] = 0; Update(playerid,pFpunishx); format(string,sizeof(string),"Giftbx: You win Clear FP from giftbox."); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", string, "OK", ""); format(string4,sizeof(string4),"%s won Clear FP from giftbox."); } } if(randgift >= 141) { PlayerInfo[playerid][pHiddenColor] += 1; Update(playerid, pHiddenColorx); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", "Ai primit o culoare hidden.", "OK", ""); format(string2,sizeof(string),"(( Giftbox: %s a castigat o culoare hidden din giftbox! Felicitari! ))",sendername); } if(randgift == 30 || randgift == 60 || randgift == 90 || randgift == 110 || randgift == 140) { if(PremiumMaxim > 0) { new randpoints = 5 + random(25); PlayerInfo[playerid][pPremiumPoints] += randpoints; Update(playerid, pPremiumPointsx); PlayerInfo[playerid][pTotalPP] += randpoints; Update(playerid, pTotalPPx); if(PlayerInfo[playerid][pTotalPP] >= 200 && PlayerInfo[playerid][pVIP] == 0) { SCM(playerid, COLOR_ORANGE, "In contul tau s-au acumulat un total de 200 PP iar acum esti un VIP User."); PlayerInfo[playerid][pVIP] = 1; Update(playerid, pVIPx); } PremiumMaxim -= 1; format(string,sizeof(string),"Giftbox: You win %d premium points from giftbox.",randpoints); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", string, "OK", ""); format(string2,sizeof(string),"(( Giftbox: %s a castigat %d puncte premium din giftbox! Felicitari! ))",sendername, randpoints); } else { new randmoney = 4000000 + random(1000000); GivePlayerCash(playerid, randmoney); Update(playerid, pCashx); format(string,sizeof(string),"Giftbox: You win $%s from giftbox.",FormatNumber(randmoney)); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", string, "OK", ""); format(string4,sizeof(string4),"%s won $%s from giftbox.",sendername,FormatNumber(randmoney)); } } if(randgift >= 142) { InsertPCar(playerid,522,Stock[10][vPrice],"NRG-500",1); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", "Giftbox: You won a bike (NRG-500) from giftbox!", "OK", ""); format(string2,sizeof(string),"(( Giftbox: %s a castigat motocicleta de tip NRG-500! Felicitari! ))",sendername); } new y,m,d,h,mi,s; getdate(y,m,d); gettime(h,mi,s); PlayerInfo[playerid][pGiftTime] += 3; ProxDetector(30.0, playerid, string4, COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW); SendClientMessageToAll(COLOR_GENANNOUNCE,string2); Update(playerid, pGiftTimex); mysql_format(SQL, string, sizeof(string), "INSERT INTO giftbox_logs (`text`,`PlayerID`,`time`) VALUES ('%s','%d','%02d/%02d/%d %02d:%02d:%02d')", string, PlayerInfo[playerid][pSQLID],d,m,y,h,mi,s); mysql_tquery(SQL,string,"",""); } else { SendClientMessage(playerid, COLOR_WHITE, "Nu esti langa un giftbox."); SendClientMessage(playerid, COLOR_YELLOW, "Iti poti luat cadoul urmarind checkpoint-ul!"); SetPlayerCheckpoint(playerid, 834.2477,-2052.5186,12.8672, 5.0); CP[playerid] = 43; return 1; } } else if(PlayerInfo[playerid][pGiftBox] == 2) // asa faci si la giftbox 2/3/4 { if(IsPlayerInRangeOfPoint(playerid, 5.0, 2869.4817,-1589.1746,22.4913)) { new randgift = random(150),string[256],sendername[30],string2[256],string4[256]; GetPlayerName(playerid,sendername,sizeof(sendername)); if(randgift >= 0 && randgift <= 29) { new randmats = 2000 + random(28000); PlayerInfo[playerid][pMats] += randmats; Update(playerid, pMatsx); format(string,sizeof(string),"Giftbox: Ai castigat %d materiale din giftbox",randmats); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", string, "OK", ""); format(string4,sizeof(string4),"%s won %d Materials from giftbox.", sendername,randmats); } if(randgift >= 31 && randgift <= 59) { new str[1400]; PlayerInfo[playerid][pCarLic] = 1; PlayerInfo[playerid][pCarLicT] = 500; PlayerInfo[playerid][pFlyLic] = 1; PlayerInfo[playerid][pFlyLicT] = 500; PlayerInfo[playerid][pBoatLic] = 1; PlayerInfo[playerid][pBoatLicT] = 500; PlayerInfo[playerid][pGunLic] = 1; PlayerInfo[playerid][pGunLicT] = 500; mysql_format(SQL,str,1400,"UPDATE users SET `CarLic`='1',`CarLicT`='500',`FlyLic`='1',`FlyLicT`='500',`BoatLic`='1',`BoatLicT`='500',`GunLic`='1',`GunLicT`='500' WHERE `name`='%s'",PlayerInfo[playerid][pNormalName]); mysql_tquery(SQL,str,"",""); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", "Ai primit toate licentele pentru 500 ore.", "OK", ""); format(string2,sizeof(string),"(( Giftbox: %s a castigat toate licentele pentru 500 ore din giftbox! Felicitari! ))",sendername); } if(randgift >= 61 && randgift <= 89) { new randfw = 5 + random(20),str2[256]; PlayerInfo[playerid][pFWorks] += randfw; mysql_format(SQL,str2,sizeof(str2),"UPDATE users SET `FWorks`='%d' WHERE `name`='%s'",PlayerInfo[playerid][pFWorks],PlayerInfo[playerid][pNormalName]); mysql_tquery(SQL,str2,"",""); format(string,sizeof(string),"Giftbox: Ai castigat %d artificii.",randfw); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", string, "OK", ""); format(string4,sizeof(string4),"%s won %d Fireworks from giftbox.",sendername,randfw); } if(randgift >= 91 && randgift <= 109) { new randm = random(100); if(randm >= 0 && randm <= 30) { new randmoney = 100000 + random(100000); GivePlayerCash(playerid, randmoney); Update(playerid, pCashx); format(string,sizeof(string),"Giftbox: You win $%s from giftbox.",FormatNumber(randmoney)); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", string, "OK", ""); format(string4,sizeof(string4),"%s won $%s from giftbox.",sendername,FormatNumber(randmoney)); } if(randm >= 31 && randm <= 50) { new randmoney = 300000 + random(200000); GivePlayerCash(playerid, randmoney); Update(playerid, pCashx); format(string,sizeof(string),"Giftbox: You win $%s from giftbox.",FormatNumber(randmoney)); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", string, "OK", ""); format(string4,sizeof(string4),"%s won $%s from giftbox.",sendername,FormatNumber(randmoney)); } if(randm >= 51 && randm <= 80) { new randmoney = 500000 + random(500000); GivePlayerCash(playerid, randmoney); Update(playerid, pCashx); format(string,sizeof(string),"Giftbox: You win $%s from giftbox.",FormatNumber(randmoney)); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", string, "OK", ""); format(string4,sizeof(string4),"%s won $%s from giftbox.",sendername,FormatNumber(randmoney)); } if(randm >= 81 && randm <= 90) { new randmoney = 1000000 + random(500000); GivePlayerCash(playerid, randmoney); Update(playerid, pCashx); format(string,sizeof(string),"Giftbox: You win $%s from giftbox.",FormatNumber(randmoney)); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", string, "OK", ""); format(string4,sizeof(string4),"%s won $%s from giftbox.",sendername,FormatNumber(randmoney)); } if(randm >= 91) { new randmoney = 2000000 + random(1000000); GivePlayerCash(playerid, randmoney); Update(playerid, pCashx); format(string,sizeof(string),"Giftbox: You win $%s from giftbox.",FormatNumber(randmoney)); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", string, "OK", ""); format(string4,sizeof(string4),"%s won $%s from giftbox.",sendername,FormatNumber(randmoney)); } } if(randgift >= 111 && randgift <= 119) { new randmoney = 1000000 + random(1000000); GivePlayerCash(playerid, randmoney); Update(playerid, pCashx); format(string,sizeof(string),"Giftbox: You win $%s from giftbox.",FormatNumber(randmoney)); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", string, "OK", ""); format(string4,sizeof(string4),"%s won $%s from giftbox.",sendername,FormatNumber(randmoney)); } if(randgift >= 120 && randgift <= 129) { if(PlayerInfo[playerid][pWarns] == 0) { new randmoney = 1000000 + random(1000000); GivePlayerCash(playerid, randmoney); Update(playerid, pCashx); format(string,sizeof(string),"Giftbox: You win $%s from giftbox.",FormatNumber(randmoney)); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", string, "OK", ""); format(string4,sizeof(string4),"%s won $%s from giftbox.",sendername,FormatNumber(randmoney)); } else { PlayerInfo[playerid][pWarns] = 0; Update(playerid, pWarnsx); format(string,sizeof(string),"Giftbox: You win Clear Warns from giftbox"); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", string, "OK", ""); format(string4,sizeof(string4),"%s won Clear Warns from giftbox."); } } if(randgift >= 130 && randgift <= 139) { if(PlayerInfo[playerid][pFpunish] == 0) { new randmoney = 1000000 + random(1000000); GivePlayerCash(playerid, randmoney); Update(playerid, pCashx); format(string,sizeof(string),"Giftbox: You win $%s from giftbox.",FormatNumber(randmoney)); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", string, "OK", ""); format(string4,sizeof(string4),"%s won $%s from giftbox.",sendername,FormatNumber(randmoney)); } else { PlayerInfo[playerid][pFpunish] = 0; Update(playerid,pFpunishx); format(string,sizeof(string),"Giftbx: You win Clear FP from giftbox."); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", string, "OK", ""); format(string4,sizeof(string4),"%s won Clear FP from giftbox."); } } if(randgift >= 141) { PlayerInfo[playerid][pHiddenColor] += 1; Update(playerid, pHiddenColorx); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", "Ai primit o culoare hidden.", "OK", ""); format(string2,sizeof(string),"(( Giftbox: %s a castigat o culoare hidden din giftbox! Felicitari! ))",sendername); } if(randgift == 30 || randgift == 60 || randgift == 90 || randgift == 110 || randgift == 140) { if(PremiumMaxim > 0) { new randpoints = 5 + random(62); PlayerInfo[playerid][pPremiumPoints] += randpoints; Update(playerid, pPremiumPointsx); PlayerInfo[playerid][pTotalPP] += randpoints; Update(playerid, pTotalPPx); if(PlayerInfo[playerid][pTotalPP] >= 200 && PlayerInfo[playerid][pVIP] == 0) { SCM(playerid, COLOR_ORANGE, "In contul tau s-au acumulat un total de 200 PP iar acum esti un VIP User."); PlayerInfo[playerid][pVIP] = 1; Update(playerid, pVIPx); } PremiumMaxim -= 1; format(string,sizeof(string),"Giftbox: You win %d premium points from giftbox.",randpoints); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", string, "OK", ""); format(string2,sizeof(string),"(( Giftbox: %s a castigat %d puncte premium din giftbox! Felicitari! ))",sendername, randpoints); } else { new randmoney = 4000000 + random(1000000); GivePlayerCash(playerid, randmoney); Update(playerid, pCashx); format(string,sizeof(string),"Giftbox: You win $%s from giftbox.",FormatNumber(randmoney)); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", string, "OK", ""); format(string4,sizeof(string4),"%s won $%s from giftbox.",sendername,FormatNumber(randmoney)); } } if(randgift >= 142) { InsertPCar(playerid,522,Stock[10][vPrice],"NRG-500",1); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", "Giftbox: You won a bike (NRG-500) from giftbox!", "OK", ""); format(string2,sizeof(string),"(( Giftbox: %s a castigat motocicleta de tip NRG-500! Felicitari! ))",sendername); } new y,m,d,h,mi,s; getdate(y,m,d); gettime(h,mi,s); PlayerInfo[playerid][pGiftTime] += 3; ProxDetector(30.0, playerid, string4, COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW); SendClientMessageToAll(COLOR_GENANNOUNCE,string2); Update(playerid, pGiftTimex); mysql_format(SQL, string, sizeof(string), "INSERT INTO giftbox_logs (`text`,`PlayerID`,`time`) VALUES ('%s','%d','%02d/%02d/%d %02d:%02d:%02d')", string, PlayerInfo[playerid][pSQLID],d,m,y,h,mi,s); mysql_tquery(SQL,string,"",""); } else { SendClientMessage(playerid, COLOR_WHITE, "Nu esti langa un giftbox."); SendClientMessage(playerid, COLOR_YELLOW, "Iti poti luat cadoul urmarind checkpoint-ul!"); SetPlayerCheckpoint(playerid, 2869.4817,-1589.1746,22.4913, 5.0); CP[playerid] = 43; return 1; } } else if(PlayerInfo[playerid][pGiftBox] == 3) // asa faci si la giftbox 2/3/4 { if(IsPlayerInRangeOfPoint(playerid, 5.0, 1879.8340,1977.6876,13.7848)) { new randgift = random(150),string[256],sendername[30],string2[256],string4[256]; GetPlayerName(playerid,sendername,sizeof(sendername)); if(randgift >= 0 && randgift <= 29) { new randmats = 2000 + random(28000); PlayerInfo[playerid][pMats] += randmats; Update(playerid, pMatsx); format(string,sizeof(string),"Giftbox: Ai castigat %d materiale din giftbox",randmats); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", string, "OK", ""); format(string4,sizeof(string4),"%s won %d Materials from giftbox.",sendername, randmats); } if(randgift >= 31 && randgift <= 59) { new str[1400]; PlayerInfo[playerid][pCarLic] = 1; PlayerInfo[playerid][pCarLicT] = 500; PlayerInfo[playerid][pFlyLic] = 1; PlayerInfo[playerid][pFlyLicT] = 500; PlayerInfo[playerid][pBoatLic] = 1; PlayerInfo[playerid][pBoatLicT] = 500; PlayerInfo[playerid][pGunLic] = 1; PlayerInfo[playerid][pGunLicT] = 500; mysql_format(SQL,str,1400,"UPDATE users SET `CarLic`='1',`CarLicT`='500',`FlyLic`='1',`FlyLicT`='500',`BoatLic`='1',`BoatLicT`='500',`GunLic`='1',`GunLicT`='500' WHERE `name`='%s'",PlayerInfo[playerid][pNormalName]); mysql_tquery(SQL,str,"",""); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", "Ai primit toate licentele pentru 500 ore.", "OK", ""); format(string2,sizeof(string),"(( Giftbox: %s a castigat toate licentele pentru 500 ore din giftbox! Felicitari! ))",sendername); } if(randgift >= 61 && randgift <= 89) { new randfw = 5 + random(20),str2[256]; PlayerInfo[playerid][pFWorks] += randfw; mysql_format(SQL,str2,sizeof(str2),"UPDATE users SET `FWorks`='%d' WHERE `name`='%s'",PlayerInfo[playerid][pFWorks],PlayerInfo[playerid][pNormalName]); mysql_tquery(SQL,str2,"",""); format(string,sizeof(string),"Giftbox: Ai castigat %d artificii.",randfw); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", string, "OK", ""); format(string4,sizeof(string4),"%s won %d Fireworks from giftbox.",sendername,randfw); } if(randgift >= 91 && randgift <= 109) { new randm = random(100); if(randm >= 0 && randm <= 30) { new randmoney = 100000 + random(100000); GivePlayerCash(playerid, randmoney); Update(playerid, pCashx); format(string,sizeof(string),"Giftbox: You win $%s from giftbox.",FormatNumber(randmoney)); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", string, "OK", ""); format(string4,sizeof(string4),"%s won $%s from giftbox.",sendername,FormatNumber(randmoney)); } if(randm >= 31 && randm <= 50) { new randmoney = 300000 + random(200000); GivePlayerCash(playerid, randmoney); Update(playerid, pCashx); format(string,sizeof(string),"Giftbox: You win $%s from giftbox.",FormatNumber(randmoney)); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", string, "OK", ""); format(string4,sizeof(string4),"%s won $%s from giftbox.",sendername,FormatNumber(randmoney)); } if(randm >= 51 && randm <= 80) { new randmoney = 500000 + random(500000); GivePlayerCash(playerid, randmoney); Update(playerid, pCashx); format(string,sizeof(string),"Giftbox: You win $%s from giftbox.",FormatNumber(randmoney)); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", string, "OK", ""); format(string4,sizeof(string4),"%s won $%s from giftbox.",sendername,FormatNumber(randmoney)); } if(randm >= 81 && randm <= 90) { new randmoney = 1000000 + random(500000); GivePlayerCash(playerid, randmoney); Update(playerid, pCashx); format(string,sizeof(string),"Giftbox: You win $%s from giftbox.",FormatNumber(randmoney)); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", string, "OK", ""); format(string4,sizeof(string4),"%s won $%s from giftbox.",sendername,FormatNumber(randmoney)); } if(randm >= 91) { new randmoney = 2000000 + random(1000000); GivePlayerCash(playerid, randmoney); Update(playerid, pCashx); format(string,sizeof(string),"Giftbox: You win $%s from giftbox.",FormatNumber(randmoney)); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", string, "OK", ""); format(string4,sizeof(string4),"%s won $%s from giftbox.",sendername,FormatNumber(randmoney)); } } if(randgift >= 111 && randgift <= 119) { new randmoney = 1000000 + random(1000000); GivePlayerCash(playerid, randmoney); Update(playerid, pCashx); format(string,sizeof(string),"Giftbox: You win $%s from giftbox.",FormatNumber(randmoney)); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", string, "OK", ""); format(string4,sizeof(string4),"%s won $%s from giftbox.",sendername,FormatNumber(randmoney)); } if(randgift >= 120 && randgift <= 129) { if(PlayerInfo[playerid][pWarns] == 0) { new randmoney = 1000000 + random(1000000); GivePlayerCash(playerid, randmoney); Update(playerid, pCashx); format(string,sizeof(string),"Giftbox: You win $%s from giftbox.",FormatNumber(randmoney)); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", string, "OK", ""); format(string4,sizeof(string4),"%s won $%s from giftbox.",sendername,FormatNumber(randmoney)); } else { PlayerInfo[playerid][pWarns] = 0; Update(playerid, pWarnsx); format(string,sizeof(string),"Giftbox: You win Clear Warns from giftbox"); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", string, "OK", ""); format(string4,sizeof(string4),"%s won Clear Warns from giftbox."); } } if(randgift >= 130 && randgift <= 139) { if(PlayerInfo[playerid][pFpunish] == 0) { new randmoney = 1000000 + random(1000000); GivePlayerCash(playerid, randmoney); Update(playerid, pCashx); format(string,sizeof(string),"Giftbox: You win $%s from giftbox.",FormatNumber(randmoney)); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", string, "OK", ""); format(string4,sizeof(string4),"%s won $%s from giftbox.",sendername,FormatNumber(randmoney)); } else { PlayerInfo[playerid][pFpunish] = 0; Update(playerid,pFpunishx); format(string,sizeof(string),"Giftbx: You win Clear FP from giftbox."); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", string, "OK", ""); format(string4,sizeof(string4),"%s won Clear FP from giftbox."); } } if(randgift >= 141) { PlayerInfo[playerid][pHiddenColor] += 1; Update(playerid, pHiddenColorx); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", "Ai primit o culoare hidden.", "OK", ""); format(string2,sizeof(string),"(( Giftbox: %s a castigat o culoare hidden din giftbox! Felicitari! ))",sendername); } if(randgift == 30 || randgift == 60 || randgift == 90 || randgift == 110 || randgift == 140) { if(PremiumMaxim > 0) { new randpoints = 5 + random(62); PlayerInfo[playerid][pPremiumPoints] += randpoints; Update(playerid, pPremiumPointsx); PlayerInfo[playerid][pTotalPP] += randpoints; Update(playerid, pTotalPPx); if(PlayerInfo[playerid][pTotalPP] >= 200 && PlayerInfo[playerid][pVIP] == 0) { SCM(playerid, COLOR_ORANGE, "In contul tau s-au acumulat un total de 200 PP iar acum esti un VIP User."); PlayerInfo[playerid][pVIP] = 1; Update(playerid, pVIPx); } PremiumMaxim -= 1; format(string,sizeof(string),"Giftbox: You win %d premium points from giftbox.",randpoints); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", string, "OK", ""); format(string2,sizeof(string),"(( Giftbox: %s a castigat %d puncte premium din giftbox! Felicitari! ))",sendername, randpoints); } else { new randmoney = 4000000 + random(1000000); GivePlayerCash(playerid, randmoney); Update(playerid, pCashx); format(string,sizeof(string),"Giftbox: You win $%s from giftbox.",FormatNumber(randmoney)); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", string, "OK", ""); format(string4,sizeof(string4),"%s won $%s from giftbox.",sendername,FormatNumber(randmoney)); } } if(randgift >= 142) { InsertPCar(playerid,522,Stock[10][vPrice],"NRG-500",1); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", "Giftbox: You won a bike (NRG-500) from giftbox!", "OK", ""); format(string2,sizeof(string),"(( Giftbox: %s a castigat motocicleta de tip NRG-500! Felicitari! ))",sendername); } new y,m,d,h,mi,s; getdate(y,m,d); gettime(h,mi,s); PlayerInfo[playerid][pGiftTime] += 3; ProxDetector(30.0, playerid, string4, COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW); SendClientMessageToAll(COLOR_GENANNOUNCE,string2); Update(playerid, pGiftTimex); mysql_format(SQL, string, sizeof(string), "INSERT INTO giftbox_logs (`text`,`PlayerID`,`time`) VALUES ('%s','%d','%02d/%02d/%d %02d:%02d:%02d')", string, PlayerInfo[playerid][pSQLID],d,m,y,h,mi,s); mysql_tquery(SQL,string,"",""); } else { SendClientMessage(playerid, COLOR_WHITE, "Nu esti langa un giftbox."); SendClientMessage(playerid, COLOR_YELLOW, "Iti poti luat cadoul urmarind checkpoint-ul!"); SetPlayerCheckpoint(playerid, 1879.8340,1977.6876,13.7848, 5.0); CP[playerid] = 43; return 1; } } else if(PlayerInfo[playerid][pGiftBox] == 4) // asa faci si la giftbox 2/3/4 { if(IsPlayerInRangeOfPoint(playerid, 5.0, -791.5663,1436.9779,13.78913)) { new randgift = random(150),string[256],sendername[30],string2[256],string4[256]; GetPlayerName(playerid,sendername,sizeof(sendername)); if(randgift >= 0 && randgift <= 29) { new randmats = 2000 + random(28000); PlayerInfo[playerid][pMats] += randmats; Update(playerid, pMatsx); format(string,sizeof(string),"Giftbox: Ai castigat %d materiale din giftbox",randmats); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", string, "OK", ""); format(string4,sizeof(string4),"%s won %d Materials from giftbox.", sendername,randmats); } if(randgift >= 31 && randgift <= 59) { new str[1400]; PlayerInfo[playerid][pCarLic] = 1; PlayerInfo[playerid][pCarLicT] = 500; PlayerInfo[playerid][pFlyLic] = 1; PlayerInfo[playerid][pFlyLicT] = 500; PlayerInfo[playerid][pBoatLic] = 1; PlayerInfo[playerid][pBoatLicT] = 500; PlayerInfo[playerid][pGunLic] = 1; PlayerInfo[playerid][pGunLicT] = 500; mysql_format(SQL,str,1400,"UPDATE users SET `CarLic`='1',`CarLicT`='500',`FlyLic`='1',`FlyLicT`='500',`BoatLic`='1',`BoatLicT`='500',`GunLic`='1',`GunLicT`='500' WHERE `name`='%s'",PlayerInfo[playerid][pNormalName]); mysql_tquery(SQL,str,"",""); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", "Ai primit toate licentele pentru 500 ore.", "OK", ""); format(string2,sizeof(string),"(( Giftbox: %s a castigat toate licentele pentru 500 ore din giftbox! Felicitari! ))",sendername); } if(randgift >= 61 && randgift <= 89) { new randfw = 5 + random(20),str2[256]; PlayerInfo[playerid][pFWorks] += randfw; mysql_format(SQL,str2,sizeof(str2),"UPDATE users SET `FWorks`='%d' WHERE `name`='%s'",PlayerInfo[playerid][pFWorks],PlayerInfo[playerid][pNormalName]); mysql_tquery(SQL,str2,"",""); format(string,sizeof(string),"Giftbox: Ai castigat %d artificii.",randfw); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", string, "OK", ""); format(string4,sizeof(string4),"%s won %d Fireworks from giftbox.",sendername,randfw); } if(randgift >= 91 && randgift <= 109) { new randm = random(100); if(randm >= 0 && randm <= 30) { new randmoney = 100000 + random(100000); GivePlayerCash(playerid, randmoney); Update(playerid, pCashx); format(string,sizeof(string),"Giftbox: You win $%s from giftbox.",FormatNumber(randmoney)); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", string, "OK", ""); format(string4,sizeof(string4),"%s won $%s from giftbox.",sendername,FormatNumber(randmoney)); } if(randm >= 31 && randm <= 50) { new randmoney = 300000 + random(200000); GivePlayerCash(playerid, randmoney); Update(playerid, pCashx); format(string,sizeof(string),"Giftbox: You win $%s from giftbox.",FormatNumber(randmoney)); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", string, "OK", ""); format(string4,sizeof(string4),"%s won $%s from giftbox.",sendername,FormatNumber(randmoney)); } if(randm >= 51 && randm <= 80) { new randmoney = 500000 + random(500000); GivePlayerCash(playerid, randmoney); Update(playerid, pCashx); format(string,sizeof(string),"Giftbox: You win $%s from giftbox.",FormatNumber(randmoney)); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", string, "OK", ""); format(string4,sizeof(string4),"%s won $%s from giftbox.",sendername,FormatNumber(randmoney)); } if(randm >= 81 && randm <= 90) { new randmoney = 1000000 + random(500000); GivePlayerCash(playerid, randmoney); Update(playerid, pCashx); format(string,sizeof(string),"Giftbox: You win $%s from giftbox.",FormatNumber(randmoney)); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", string, "OK", ""); format(string4,sizeof(string4),"%s won $%s from giftbox.",sendername,FormatNumber(randmoney)); } if(randm >= 91) { new randmoney = 2000000 + random(1000000); GivePlayerCash(playerid, randmoney); Update(playerid, pCashx); format(string,sizeof(string),"Giftbox: You win $%s from giftbox.",FormatNumber(randmoney)); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", string, "OK", ""); format(string4,sizeof(string4),"%s won $%s from giftbox.",sendername,FormatNumber(randmoney)); } } if(randgift >= 111 && randgift <= 119) { new randmoney = 1000000 + random(1000000); GivePlayerCash(playerid, randmoney); Update(playerid, pCashx); format(string,sizeof(string),"Giftbox: You win $%s from giftbox.",FormatNumber(randmoney)); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", string, "OK", ""); format(string4,sizeof(string4),"%s won $%s from giftbox.",sendername,FormatNumber(randmoney)); } if(randgift >= 120 && randgift <= 129) { if(PlayerInfo[playerid][pWarns] == 0) { new randmoney = 1000000 + random(1000000); GivePlayerCash(playerid, randmoney); Update(playerid, pCashx); format(string,sizeof(string),"Giftbox: You win $%s from giftbox.",FormatNumber(randmoney)); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", string, "OK", ""); format(string4,sizeof(string4),"%s won $%s from giftbox.",sendername,FormatNumber(randmoney)); } else { PlayerInfo[playerid][pWarns] = 0; Update(playerid, pWarnsx); format(string,sizeof(string),"Giftbox: You win Clear Warns from giftbox"); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", string, "OK", ""); format(string4,sizeof(string4),"%s won Clear Warns from giftbox."); } } if(randgift >= 130 && randgift <= 139) { if(PlayerInfo[playerid][pFpunish] == 0) { new randmoney = 1000000 + random(1000000); GivePlayerCash(playerid, randmoney); Update(playerid, pCashx); format(string,sizeof(string),"Giftbox: You win $%s from giftbox.",FormatNumber(randmoney)); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", string, "OK", ""); format(string4,sizeof(string4),"%s won $%s from giftbox.",sendername,FormatNumber(randmoney)); } else { PlayerInfo[playerid][pFpunish] = 0; Update(playerid,pFpunishx); format(string,sizeof(string),"Giftbx: You win Clear FP from giftbox."); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", string, "OK", ""); format(string4,sizeof(string4),"%s won Clear FP from giftbox."); } } if(randgift >= 141) { PlayerInfo[playerid][pHiddenColor] += 1; Update(playerid, pHiddenColorx); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", "Ai primit o culoare hidden.", "OK", ""); format(string2,sizeof(string),"(( Giftbox: %s a castigat o culoare hidden din giftbox! Felicitari! ))",sendername); } if(randgift == 30 || randgift == 60 || randgift == 90 || randgift == 110 || randgift == 140) { if(PremiumMaxim > 0) { new randpoints = 5 + random(62); PlayerInfo[playerid][pPremiumPoints] += randpoints; Update(playerid, pPremiumPointsx); PlayerInfo[playerid][pTotalPP] += randpoints; Update(playerid, pTotalPPx); if(PlayerInfo[playerid][pTotalPP] >= 200 && PlayerInfo[playerid][pVIP] == 0) { SCM(playerid, COLOR_ORANGE, "In contul tau s-au acumulat un total de 200 PP iar acum esti un VIP User."); PlayerInfo[playerid][pVIP] = 1; Update(playerid, pVIPx); } PremiumMaxim -= 1; format(string,sizeof(string),"Giftbox: You win %d premium points from giftbox.",randpoints); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", string, "OK", ""); format(string2,sizeof(string),"(( Giftbox: %s a castigat %d puncte premium din giftbox! Felicitari! ))",sendername, randpoints); } else { new randmoney = 4000000 + random(1000000); GivePlayerCash(playerid, randmoney); Update(playerid, pCashx); format(string,sizeof(string),"Giftbox: You win $%s from giftbox.",FormatNumber(randmoney)); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", string, "OK", ""); format(string4,sizeof(string4),"%s won $%s from giftbox.",sendername,FormatNumber(randmoney)); } } if(randgift >= 142) { InsertPCar(playerid,522,Stock[10][vPrice],"NRG-500",1); ShowPlayerDialog(playerid, DIALOG_GIFTBOX, DIALOG_STYLE_MSGBOX, "Giftbox", "Giftbox: You won a bike (NRG-500) from giftbox!", "OK", ""); format(string2,sizeof(string),"(( Giftbox: %s a castigat motocicleta de tip NRG-500! Felicitari! ))",sendername); } new y,m,d,h,mi,s; getdate(y,m,d); gettime(h,mi,s); PlayerInfo[playerid][pGiftTime] += 3; ProxDetector(30.0, playerid, string4, COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW); SendClientMessageToAll(COLOR_GENANNOUNCE,string2); Update(playerid, pGiftTimex); mysql_format(SQL, string, sizeof(string), "INSERT INTO giftbox_logs (`text`,`PlayerID`,`time`) VALUES ('%s','%d','%02d/%02d/%d %02d:%02d:%02d')", string, PlayerInfo[playerid][pSQLID],d,m,y,h,mi,s); mysql_tquery(SQL,string,"",""); } else { SendClientMessage(playerid, COLOR_WHITE, "Nu esti langa un giftbox."); SendClientMessage(playerid, COLOR_YELLOW, "Iti poti luat cadoul urmarind checkpoint-ul!"); SetPlayerCheckpoint(playerid, -791.5663,1436.9779,13.78913, 5.0); CP[playerid] = 43; return 1; } } return 1; } Nu stiu daca iti este compatibila, dar o poti incerca. Nu a fost compatibil de la inceput, am schimbat eu niste chestii si acum merge. Mersi mult! Quote
CrImA Posted January 21, 2017 Posted January 21, 2017 Si ce ti-am dat eu era bun doar ca n-ai stiut sa modifici peste tot. Probabil ai modificat doar la asta si tu aveai mai multe sanse cu bani, nu doar 0-30. if(randm >= 0 && randm <= 30) De ex daca mai aveai bani cand randm era > 50 si < 70 trebuia sa pui si la alea %s. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.