AnDrEyUpS Posted July 10, 2019 Report Share Posted July 10, 2019 (edited) Buna ziua ,ma numesc Andrei. Am si eu un system de /getgift Problema : Cand folosesc comanda /getgift o mai pot folosii de cate ori vreau si asta nu imi place. Ma-ti putea ajuta cu un timer de 1ora ? GameMode:wa-rpg GameMode=Shane de pe youtube. Folosesc: YCMD. Dau +1 daca voi fi ajutat .Pupi Edited June 9, 2020 by AnDrEyUpS Quote Link to comment Share on other sites More sharing options...
InceMan Posted July 10, 2019 Report Share Posted July 10, 2019 poti sa faci ceva de genul pui la enum pInfo asta pGiftTimer si un new stmsg[168]; asta e sa seteze timer-ul la 240 la cont premium si fara cont premium la 300 if(PlayerInfo[playerid][pPremiumAccount] == 0 ? (PlayerInfo[playerid][pGiftTimer] = gettime()+300) : (PlayerInfo[playerid][pGiftTimer] = gettime()+240)) si asta este restrictia de asteptare if(PlayerInfo[playerid][pGiftTimer] > gettime()) return format(stmsg[playerid], 80, "Trebuie să așteptați %02i:%02i minute pentru a da /getgift din nou.", (PlayerInfo[playerid][pGiftTimer]-gettime())/60, (PlayerInfo[playerid][pGiftTimer]-gettime())%60), succes! 1 Quote FiveGame Lands Pawno Developer, Mapping , Scripter Since 2016 Link to comment Share on other sites More sharing options...
AnDrEyUpS Posted July 10, 2019 Author Report Share Posted July 10, 2019 (edited) Citeste te rog ! Edited July 11, 2019 by AnDrEyUpS Eroare Quote Link to comment Share on other sites More sharing options...
AnDrEyUpS Posted July 11, 2019 Author Report Share Posted July 11, 2019 (edited) Acum 14 ore, FiveGame a spus: poti sa faci ceva de genul pui la enum pInfo asta pGiftTimer si un new stmsg[168]; asta e sa seteze timer-ul la 240 la cont premium si fara cont premium la 300 if(PlayerInfo[playerid][pPremiumAccount] == 0 ? (PlayerInfo[playerid][pGiftTimer] = gettime()+300) : (PlayerInfo[playerid][pGiftTimer] = gettime()+240)) si asta este restrictia de asteptare if(PlayerInfo[playerid][pGiftTimer] > gettime()) return format(stmsg[playerid], 80, "Trebuie să așteptați %02i:%02i minute pentru a da /getgift din nou.", (PlayerInfo[playerid][pGiftTimer]-gettime())/60, (PlayerInfo[playerid][pGiftTimer]-gettime())%60), succes! Am intampinat urmatoarea erroare/problema la comanda ! Aceasta e comanda mea ! 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] >= 2) { 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, 153.0107,-1951.2157,5.7501)) { new rand = random(310); PlayerInfo[playerid][pGiftPoints] = 2; 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; } Eu am adaugat ce mi-ai zis tu sub if(PlayerInfo[playerid][pGiftPoints] >= 2) incloc de stmsg am pus SCM A 3-a linie de la YCMD:getgift Si primesc urmatoarele errori : (19489) : error 029: invalid expression, assumed zero (19489) : error 029: invalid expression, assumed zero (19489) : error 029: invalid expression, assumed zero (19489) : fatal error 107: too many error messages on one line Linia(19489if(PlayerInfo[playerid][pPremiumAccount] == 0 ? (PlayerInfo[playerid][pGiftTimer] = gettime()+300) : (PlayerInfo[playerid][pGiftTimer] = gettime()+240)) Spoiler Spoiler Edited July 11, 2019 by AnDrEyUpS Quote Link to comment Share on other sites More sharing options...
AnDrEyUpS Posted July 13, 2019 Author Report Share Posted July 13, 2019 T/C Quote Link to comment Share on other sites More sharing options...
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.