Jump to content

TheGodfather

Membru
  • Posts

    500
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by TheGodfather

  1. Am pus mai sus
  2. function LoadPlayerCars(playerid) { gQuery[0] = EOS; mysql_format(SQL, gQuery, sizeof(gQuery), "SELECT * FROM `cars` WHERE `Userid`='%d' LIMIT %d", PlayerInfo[playerid][pSQLID], MAX_PLAYER_VEHICLE); mysql_tquery(SQL, gQuery, "SQL_LoadVehicles", "i", playerid); return true; } function SQL_LoadVehicles(playerid) { new componenets[20], coordonate[50], Mods[50]; if(cache_num_rows() == 0) return true; for(new i = 0; i < cache_num_rows(); i++) { new id = Iter_Free(PersonalVehicles); new ORM:ormid = orm_create("cars"); orm_addvar_string(ormid, CarInfo[id][cOwner], 32, "Owner"); orm_addvar_string(ormid, CarInfo[id][cText], 32, "Text"); orm_addvar_string(ormid, CarInfo[id][cLicense], 32, "License"); orm_addvar_int(ormid, CarInfo[id][cID], "ID"); orm_addvar_int(ormid, CarInfo[id][cModel], "Model"); orm_addvar_int(ormid, CarInfo[id][cNeon], "Neon"); orm_addvar_float(ormid, CarInfo[id][cLocationx], "Locationx"); orm_addvar_float(ormid, CarInfo[id][cLocationy], "Locationy"); orm_addvar_float(ormid, CarInfo[id][cLocationz], "Locationz"); orm_addvar_float(ormid, CarInfo[id][cAngle], "Angle"); orm_addvar_float(ormid, CarInfo[id][KM], "KM"); orm_addvar_int(ormid, CarInfo[id][cTemporarTime], "TemporarTime"); orm_addvar_int(ormid, CarInfo[id][cTemporar], "Temporar"); orm_addvar_int(ormid, CarInfo[id][cVirtual], "Virtual"); orm_addvar_int(ormid, CarInfo[id][cColorOne], "ColorOne"); orm_addvar_int(ormid, CarInfo[id][cColorTwo], "ColorTwo"); orm_addvar_int(ormid, CarInfo[id][cTextColor], "ColorText"); orm_addvar_int(ormid, CarInfo[id][cValue], "Value"); orm_addvar_int(ormid, CarInfo[id][cAlarm], "Alarm"); orm_addvar_int(ormid, CarInfo[id][cLock], "Lockk"); orm_addvar_int(ormid, CarInfo[id][paintjob], "paintjob"); orm_addvar_int(ormid, CarInfo[id][Userid], "Userid"); orm_addvar_int(ormid, CarInfo[id][cTimeGoto], "TimeGoto"); orm_addvar_int(ormid, CarInfo[id][Confiscated], "Confiscated"); orm_addvar_int(ormid, CarInfo[id][cSpecial], "Special"); orm_addvar_int(ormid, CarInfo[id][cTax], "Tax"); orm_addvar_int(ormid, CarInfo[id][cPoints], "Points"); orm_addvar_int(ormid, CarInfo[id][cFuel], "Fuel"); orm_addvar_int(ormid, CarInfo[id][cVip], "VIP"); orm_addvar_int(ormid, CarInfo[id][cRainBow], "RainBow"); orm_addvar_int(ormid, CarInfo[id][cLegendary], "Legendary"); orm_addvar_int(ormid, CarInfo[id][cStage], "Stage"); orm_addvar_int(ormid, CarInfo[id][Dayss], "Days"); orm_addvar_string(ormid, componenets, 20, "Components"); orm_addvar_string(ormid, Mods, 50, "Mods"); orm_addvar_string(ormid, coordonate, 50, "Cordonate"); orm_apply_cache(ormid, i); CarInfo[id][cMaxSpeed] = GetVehicleMaxSpeed(CarInfo[id][cModel]); CarInfo[id][cTime] = -1; CarInfo[id][cOnline] = playerid; sscanf(Mods, "p<|>iiiiiiiiiiiiii", CarInfo[id][cMod][0], CarInfo[id][cMod][1], CarInfo[id][cMod][2], CarInfo[id][cMod][3], CarInfo[id][cMod][4], CarInfo[id][cMod][5], CarInfo[id][cMod][6], CarInfo[id][cMod][7], CarInfo[id][cMod][8], CarInfo[id][cMod][9], CarInfo[id][cMod][10], CarInfo[id][cMod][11], CarInfo[id][cMod][12], CarInfo[id][cMod][13]); sscanf(coordonate, "p<|>ffffff", CarInfo[id][cVipPos][0], CarInfo[id][cVipPos][1], CarInfo[id][cVipPos][2], CarInfo[id][cVipPos][3], CarInfo[id][cVipPos][4], CarInfo[id][cVipPos][5]); Iter_Add(MyVehicle[playerid], id); Iter_Add(PersonalVehicles, id); } return true; }
  3. Am pus pe ultima linie la ongamemodeinit printf("Total vehicule: %d", Iter_Count(PersonalVSpawned)); si imi arata 0, am spawnat 3 masini personale iar id-ul acestora e 37, 32 si 76 la ID DB:
  4. p.s: am incercat sa pun limita la idd si tot da eroarea
  5. Daca pun o verificare, sa faca if-ul ala doar daca e idd e mai mic decat o valoare x ar fi o solutie?
  6. Ok, o sa mai incerc. Multumesc tuturor
  7. E gm-ul lui hpq123, ala de seamana cu bhood
  8. Am scris asta in primele randuri: Tin sa mentionez ca limita unde da eroarea a fost marita de la 2k la 10k si tot asa face. Nu am nici macar 2k de masini pe sv in total deci...
  9. Salut, uneori apare eroarea aceasta in logurile serverului si nu reusesc sa imi dau seama de ce da eroare la linia asta: foreach(PersonalVSpawned, idd) if(CarInfo[idd][cTime] < gettime() && CarInfo[idd][cTime] != -1) DestroyPlayerCar(idd); Eroarea data este: [16:44:06] [debug] Run time error 4: "Array index out of bounds" [16:44:06] [debug] Accessing element at index 10001 past array upper bound 9999 [16:44:06] [debug] AMX backtrace: [16:44:06] [debug] #0 003ed390 in public DecreaseTimer () at C:\Users\x\Desktop\y\gamemodes\z.pwn:36900 Tin sa mentionez ca limita unde da eroarea a fost marita de la 2k la 10k si tot asa face. functia la care este problema este urmatoarea: task DecreaseTimer[5000]() { new string[256]; foreach(PersonalVSpawned, idd) if(CarInfo[idd][cTime] < gettime() && CarInfo[idd][cTime] != -1) DestroyPlayerCar(idd); foreach(Player, i) { if(!IsPlayerConnected(i) && IsPlayerLogged[i] != 1) continue; new Float: playerArmour; GetPlayerArmour(i, playerArmour); if(playerArmour == 100 && PlayerInfo[i][pAdmin] == 0 && GetPVarInt(i, "Armour") == 0) { if(ServerSystem[3] == 0) NightBot(i, "Cheats (armour-hack)"); } //if(FPS2[i] == 0 && AFKSeconds[i] > 120 && PlayerInfo[i][pSleeping] == 0) NightBot(i, "rakdroid"); new Float: playerHealth; GetPlayerArmour(i, playerHealth); if(playerHealth == 100 && PlayerInfo[i][pAdmin] == 0) { if(ServerSystem[8] == 0) NightBot(i, "Cheats (health-hack)"); } if(PlayerInfo[i][pWantedLevel] >= 1 && WantedTime[i] == 10) { WantedTime[i] = 0; PlayerInfo[i][pWantedLevel] --; SetPlayerWantedLevel(i, PlayerInfo[i][pWantedLevel]); Update(i, pWantedLevelx); if(PlayerInfo[i][pWantedLevel] == 0) { SCM(i, COLOR_YELLOW, "Acum nu mai ai wanted deoarece politia ti-a pierdut urma!"); PlayerTextDrawHide(i, WantedTD[i]); ClearCrime(i); finishAchievement(i, 15); } else { format(string, sizeof(string), "Politia iti pierde urma! Wanted Actual: %d", PlayerInfo[i][pWantedLevel]); SCM(i, COLOR_YELLOW, string); } format(string, sizeof(string), "%s [%d] lost 1 wanted level. W: %d", GetName(i), i, PlayerInfo[i][pWantedLevel]); SendTeamMessage(14, 0x2e64feFF, string); SendTeamMessage(3, COLOR_DBLUE, string); SendTeamMessage(2, COLOR_DBLUE, string); SendTeamMessage(1, COLOR_DBLUE, string); } if(IsPlayerInRangeOfPoint(i, 30.0, 184.3529,-1825.4983,8.7530)) { if(GetPVarInt(i, "Listening") == 0) { PlayAudioStreamForPlayer(i, beachlink, 184.3529,-1825.4983,8.7530, 30.0, 1); SetPVarInt(i, "Listening", 1); } } else { if(GetPVarInt(i, "Listening") == 1) SetPVarInt(i, "Listening", 0); } // -- Variables for(new t = 0; t < 18; t++) { if(DeelayCommand[i][t] != 0) { DeelayCommand[i][t] -= 5; if(DeelayCommand[i][t] < 0) DeelayCommand[i][t] = 0; } } for(new t = 0; t < 13; t++) { if(JobDeelay[i][t] != 0) { JobDeelay[i][t] -= 5; if(JobDeelay[i][t] < 0) JobDeelay[i][t] = 0; } } if(PlayerTime[i][0] != 0) PlayerTime[i][0] -= 5; if(PlayerTime[i][0] < 0) PlayerTime[i][0] = 0; if(PlayerInfo[i][pReportTime] >= 1) { PlayerInfo[i][pReportTime] -= 5; if(PlayerInfo[i][pReportTime] < 0) PlayerInfo[i][pReportTime] = 0; } if(PlayerInfo[i][pNewbieMute] >= 1) { PlayerInfo[i][pNewbieMute] -= 5; if(PlayerInfo[i][pNewbieMute] < 0) PlayerInfo[i][pNewbieMute] = 0; } if(FreezeTime[i] != 0) { FreezeTime[i] -= 5; if(FreezeTime[i] < 0) FreezeTime[i] = 0; if(FreezeTime[i] == 0) { SCM(i, COLOR_LIGHTBLUE, "Acum nu mai ai freeze!"); TogglePlayerControllable(i, 1); } } if(PlayerToPoint(50, i, -2317.8091,-1637.5575,483.7031)) { for(new m; m < 2; m++) { if(PlayerInfo[i][pDailyMission][m] == 7) CheckMission(i, m); } } if(PlayerToPoint(50, i, 1962.4126,-2193.3279,13.5469)) { for(new m; m < 2; m++) { if(PlayerInfo[i][pDailyMission][m] == CheckMission(i, m); } } if(PlayerToPoint(100, i, 1338.6273,2153.1045,11.0578)) { for(new m; m < 2; m++) { if(PlayerInfo[i][pDailyMission][m] == 9) CheckMission(i, m); } } } return true; }
  10. Nu pot sa descarc gm-ul de pe link
  11. Nu ai modificat nimic
  12. Primesc aceasta eroare in logurile serverului: [20:26:47] ==================================================================== [20:26:47] Error ID: 1064, Eroare: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '10/01/2021 - 20:26:47', '9', '78.97.185.115')' at line 1 [20:26:47] Callback: [20:26:47] gQuery: INSERT INTO `logs` (`Userid`, `Text`, `Date`, `Type`, `IP`) VALUES ('144', '(chat) date ca te duc eu unde mere'', '10/01/2021 - 20:26:47', '9', '78.97.185.115') [20:26:47] ==================================================================== Functie de inserare este aceasta: function InsertLog(playerid, text[], type) { new szQuery[1024], szDate[180], Year, Month, Day, Hour, Minute, Second, ip[180]; getdate(Year, Month, Day); gettime(Hour, Minute, Second); GetPlayerIp(playerid, ip, sizeof(ip)); format(szDate, sizeof(szDate), "%02d/%02d/%d - %02d:%02d:%02d", Day, Month, Year, Hour, Minute, Second); mysql_format(SQL, szQuery, sizeof(szQuery), "INSERT INTO `logs` (`Userid`, `Text`, `Date`, `Type`, `IP`) VALUES ('%d', '%s', '%s', '%d', '%s')", PlayerInfo[playerid][pSQLID], text, szDate, type, ip); mysql_tquery(SQL, szQuery, "", ""); return true; } Am cautat prin gamemode acel (chat) si am gasit la onplayertext: if(PaintType[playerid] != 0) format(string, sizeof(string), "{5088BF}%s [%d kills]: {FFFFFF}%s", GetNameEx(playerid), PKills[playerid], text); else if(PlayerInfo[playerid][pColor] != 0) format(string, sizeof(string), "{%s}%s: {FFFFFF}%s", PlayerColors(PlayerInfo[playerid][pColor]), GetNameEx(playerid), text); else format(string, sizeof(string), "{%s}%s: {FFFFFF}%s", PlayerInfo[playerid][pHelper] >= 1 || PlayerInfo[playerid][pAdmin] >= 1 && GetPVarInt(playerid, "Cover") != 1 ? ("BA0404") : ("AFAFAF"), GetNameEx(playerid), text); if(PaintType[playerid] != 0) { SendPaintMessage(PaintType[playerid], -1, string); return false; } ProxDetector(20.0, playerid, string,COLOR_WHITE); format(string, sizeof(string), "(chat) %s", text); ChatLog(GetName(playerid), playerid, string); format(string, sizeof(string), "\"%s\"", text); SetPlayerChatBubble(playerid, text, COLOR_CHATBUBBLE, 10.0, 10000); return false; Functia ChatLog este urmatoarea: function ChatLog(player[], userid, text[]) { InsertLog(userid, text, LOG_CHAT); return true; }
  13. Salut, am observat in logurile serverului ca apare aceasta eroare, ma puteti ajuta? [20:23:52] [debug] Run time error 4: "Array index out of bounds" [20:23:52] [debug] Accessing element at index 2001 past array upper bound 1999 [20:23:52] [debug] AMX backtrace: [20:23:52] [debug] #0 003ef378 in public DecreaseTimer () at C:\Users\y\Desktop\x\gamemodes\p.pwn:36388 La linia 36388 din gamemode este doar o acolada inchisa... Functia DecreaseTimer este aceasta: task DecreaseTimer[5000]() { new string[256]; foreach(PersonalVSpawned, idd) if(CarInfo[idd][cTime] < gettime() && CarInfo[idd][cTime] != -1) DestroyPlayerCar(idd); foreach(Player, i) { if(!IsPlayerConnected(i) && IsPlayerLogged[i] != 1) continue; new Float: playerArmour; GetPlayerArmour(i, playerArmour); if(playerArmour == 100 && PlayerInfo[i][pAdmin] == 0 && GetPVarInt(i, "Armour") == 0) { if(ServerSystem[3] == 0) NightBot(i, "Cheats (armour-hack)"); } //if(FPS2[i] == 0 && AFKSeconds[i] > 120 && PlayerInfo[i][pSleeping] == 0) NightBot(i, "rakdroid"); new Float: playerHealth; GetPlayerArmour(i, playerHealth); if(playerHealth == 100 && PlayerInfo[i][pAdmin] == 0) { if(ServerSystem[8] == 0) NightBot(i, "Cheats (health-hack)"); } if(PlayerInfo[i][pWantedLevel] >= 1 && WantedTime[i] == 10) { WantedTime[i] = 0; PlayerInfo[i][pWantedLevel] --; SetPlayerWantedLevel(i, PlayerInfo[i][pWantedLevel]); Update(i, pWantedLevelx); if(PlayerInfo[i][pWantedLevel] == 0) { SCM(i, COLOR_YELLOW, "Acum nu mai ai wanted deoarece politia ti-a pierdut urma!"); PlayerTextDrawHide(i, WantedTD[i]); ClearCrime(i); finishAchievement(i, 15); } else { format(string, sizeof(string), "Politia iti pierde urma! Wanted Actual: %d", PlayerInfo[i][pWantedLevel]); SCM(i, COLOR_YELLOW, string); } format(string, sizeof(string), "%s [%d] lost 1 wanted level. W: %d", GetName(i), i, PlayerInfo[i][pWantedLevel]); SendTeamMessage(14, 0x2e64feFF, string); SendTeamMessage(3, COLOR_DBLUE, string); SendTeamMessage(2, COLOR_DBLUE, string); SendTeamMessage(1, COLOR_DBLUE, string); } if(IsPlayerInRangeOfPoint(i, 30.0, 184.3529,-1825.4983,8.7530)) { if(GetPVarInt(i, "Listening") == 0) { PlayAudioStreamForPlayer(i, beachlink, 184.3529,-1825.4983,8.7530, 30.0, 1); SetPVarInt(i, "Listening", 1); } } else { if(GetPVarInt(i, "Listening") == 1) SetPVarInt(i, "Listening", 0); } // -- Variables for(new t = 0; t < 18; t++) { if(DeelayCommand[i][t] != 0) { DeelayCommand[i][t] -= 5; if(DeelayCommand[i][t] < 0) DeelayCommand[i][t] = 0; } } for(new t = 0; t < 13; t++) { if(JobDeelay[i][t] != 0) { JobDeelay[i][t] -= 5; if(JobDeelay[i][t] < 0) JobDeelay[i][t] = 0; } } if(PlayerTime[i][0] != 0) PlayerTime[i][0] -= 5; if(PlayerTime[i][0] < 0) PlayerTime[i][0] = 0; if(PlayerInfo[i][pReportTime] >= 1) { PlayerInfo[i][pReportTime] -= 5; if(PlayerInfo[i][pReportTime] < 0) PlayerInfo[i][pReportTime] = 0; } if(PlayerInfo[i][pNewbieMute] >= 1) { PlayerInfo[i][pNewbieMute] -= 5; if(PlayerInfo[i][pNewbieMute] < 0) PlayerInfo[i][pNewbieMute] = 0; } if(FreezeTime[i] != 0) { FreezeTime[i] -= 5; if(FreezeTime[i] < 0) FreezeTime[i] = 0; if(FreezeTime[i] == 0) { SCM(i, COLOR_LIGHTBLUE, "Acum nu mai ai freeze!"); TogglePlayerControllable(i, 1); } } if(PlayerToPoint(50, i, -2317.8091,-1637.5575,483.7031)) { for(new m; m < 2; m++) { if(PlayerInfo[i][pDailyMission][m] == 7) CheckMission(i, m); } } if(PlayerToPoint(50, i, 1962.4126,-2193.3279,13.5469)) { for(new m; m < 2; m++) { if(PlayerInfo[i][pDailyMission][m] == CheckMission(i, m); } } if(PlayerToPoint(100, i, 1338.6273,2153.1045,11.0578)) { for(new m; m < 2; m++) { if(PlayerInfo[i][pDailyMission][m] == 9) CheckMission(i, m); } } } return true; }
  14. Salut, am cateva obiecte pe care le iau cu tasta y si le pun pe masina, daca pun unul sau mai multe obiecte din acestea, ma urc si cobor din masina in loc sa ma dea langa usa, unde e normal ma teleporteaza aici. Nu am adaugat nimic la onplayerstatechange sau onplayerexitvehicle. Asa atasez obiectul vehicului: if(StartQuest2[playerid] != 0 && yz[playerid] <= 9) { if(HaveGift2[playerid] == 1) { new Float: Pos[3]; GetVehiclePos(QuestVehicle2[playerid], Pos[0], Pos[1], Pos[2]); if(PlayerToPoint(5, playerid, Pos[0], Pos[1], Pos[2])) {RemovePlayerAttachedObject(playerid, 0); SetPlayerSpecialAction(playerid, SPECIAL_ACTION_NONE); quest2obj[yz[playerid]] = CreateDynamicObject(1463,VipPos2[yz[playerid]][0], VipPos2[yz[playerid]][1], VipPos2[yz[playerid]][2], 0.0, 0.0, 0.0); AttachDynamicObjectToVehicle(quest2obj[yz[playerid]], QuestVehicle2[playerid], VipPos2[yz[playerid]][0], VipPos2[yz[playerid]][1], VipPos2[yz[playerid]][2], 0.0, 0.0, 0.0); yz[playerid] = yz[playerid] + 1; HaveGift2[playerid] = -1;} }
  15. Salut, cand iau aceasta servieta, imi apare un checkpoint pe harta si trebuie sa o duc acolo pentru a castiga eventul dar daca merg la o casa si intru in iconita asta imi spune ca am terminat eventul, ceea ce e incorect aici este partea de cod care verifica daca ai luat servieta: public OnPlayerPickUpPickup(playerid, pickupid) { if(pickupid == CashboxPickup) { PlayerPlaySound(playerid, 1150, 0, 0, 0); new strr[128], pName[MAX_PLAYER_NAME]; DestroyPickup(CashboxPickup); CashboxOwner = playerid; GetPlayerName(playerid, pName, sizeof(pName)); format(strr, 128, "{ff6600}%s {FFFFFF} a luat servieta! Omorati-l pana nu o duce la destinatie!", pName); SendClientMessageToAll(0xFFD700AA, strr); SendClientMessageToAll(0xFFD700AA,"{FFFFFF}Foloseste{00B1E6} /locate{FFFFFF} pentru a vedea unde se afla posesorul servietei."); SendClientMessage(playerid,0xAA3333AA,"{E4B339}Esti in posesia servietei! Du-te cu ea la destinatie cat mai repede!"); new rand = random(sizeof(DropLocation)); IsCashBoxStarted = 1; CP[playerid] = SetPlayerCheckpointEx(playerid, DropLocation[rand][0], DropLocation[rand][1], DropLocation[rand][2], 3); } }
  16. up
  17. up..
  18. up.
  19. up
  20. Salut, la gm bhood editat de hpq123, daca muncesc la jobul farmer de exemplu si ma dau jos din tractor, il distruge si imi afiseaza un mesaj. Daca incerc sa dau iar /work, imi distruge tractorul instant, nici macar nu ma mai lasa sa ma urc in el. Aici e partea cu problema. if(JobWorking[playerid] == 1 && gLastCar[playerid] == JobVehicle[playerid]) { if(PlayerInfo[playerid][pJob] == 1) { SCM(playerid, COLOR_GREY, "Job esuat! Ai parasit vehiculul.aaaa"); if(playerObject[playerid] != 0) DestroyPlayerObject(playerid, playerObject[playerid]), playerObject[playerid] = 0; if(playerObject2[playerid] != 0) DestroyObject(playerObject2[playerid]), playerObject2[playerid] = 0; JobWorking[playerid] = 0; PlayerTextDrawHide(playerid, JobTD); if(JobVehicle[playerid] != 0) { DestroyVehicle(JobVehicle[playerid]); JobVehicle[playerid] = 0; } if(Trailer[playerid] != 0) { DestroyVehicle(Trailer[playerid]); Trailer[playerid] = 0; } PlayerTextDrawHide(playerid, InfosTD); DisablePlayerCheckpointEx(playerid); DisablePlayerRaceCheckpointEx(playerid); CP[playerid] = 0; JobVehicle[playerid] = 0; RemovePlayerAttachedObject(playerid, 2); RemovePlayerAttachedObject(playerid, 6); JobDeelay[playerid][PlayerInfo[playerid][pJob]] = 180; } else JobLeftTime[playerid] = 120; }
  21. Multumesc
  22. up.
×
×
  • 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.