- 0
Bug opencrates gamemode HPQ123
-
Similar Content
-
- 47 replies
- 10,140 views
-
- 86 replies
- 25,491 views
-
- 54 replies
- 15,421 views
-
- 3 replies
- 1,388 views
-
- 7 replies
- 970 views
-
-
Recently Browsing 0 members
- No registered users viewing this page.
Question
TheGodfather
Salut, am gasit un bug legat de deschiderea de crates pe gm b-hood de HPQ123, las mai jos eroarea gasita in logurile serverului.
[12:20:54] [debug] Run time error 4: "Array index out of bounds"
[12:20:54] [debug] Accessing element at negative index -2
[12:20:54] [debug] AMX backtrace:
[12:20:54] [debug] #0 003f3b1c in public opencrates (i=0) at C:\Users\crist\Desktop\HPQ123 samp gamemode actual cu tot ce trebuie\gamemodes\B-HOOD.pwn:36322
Linia 36322 este aceasta: format(gString, 70, "skin %d (%s)~n~~w~~h~you have %d crates.", amount, CrateName[x], totalcrates(i));
Las mai jos functiile unde apare acel public opencrates:
function startcrates(playerid) {
for(new l = 0; l < 6; l++) TextDrawShowForPlayer(playerid, CrateTD[l]);
opencrates(playerid);
PlayerTextDrawShow(playerid, CratePTD[1]);
TimerCratesEx[playerid] = SetTimerEx("opencrates", 500, true, "d", playerid);
return true;
}
function opencrates(i) {
gString[0] = EOS;
CrateTime[i] --;
new amount, rand = random(100), x = !CrateModel[i] ? 0 : CrateModel[i]-1;
if(CrateModel[i] != 5) {
switch(rand) {
case 0..10: {
LoadSkins(x, amount);
format(gString, 70, "skin %d (%s)~n~~w~~h~you have %d crates.", amount, CrateName[x], totalcrates(i));
PlayerTextDrawSetPreviewModel(i, CratePTD[0], amount);
PlayerTextDrawSetString(i, CratePTD[1], gString);
PlayerTextDrawShow(i, CratePTD[0]);
if(CrateTime[i] == 0) {
if(CrateModel[i] <= 0) {
format(gString, 100,"%s, ai deschis o cutie de test si puteai castiga skinul %d (%s).", GetName(i), amount, CrateName[x]);
SCM(i, COLOR_WHITE, gString);
} else {
if(total_skins(i) == 10) {
PlayerInfo[i][pCrates][x] ++;
save_crates(i);
SCM(i, COLOR_LGREEN, "You won the skin, because you already have 10 skins you got the craft back!");
} else {
format(gString, 120,"(( {%s}%s Crate {A9C4E4}- %s opened a box and won skin %d [%s]. ))", CrateColors[x], CrateName[x], GetName(i), amount, CrateName[x]);
SCMTA(COLOR_CLIENT, gString);
give_skin(i, amount);
}
}
KillTimer(TimerCratesEx[i]);
CrateModel[i] = -1;
}
}
case 11..30: {
amount = random(5) + x * 4;
format(gString, 75, "~y~%s Respect points~n~~w~~h~you have %d crates.", FormatNumber(amount), totalcrates(i));
PlayerTextDrawSetPreviewModel(i, CratePTD[0], 1275);
PlayerTextDrawSetString(i, CratePTD[1], gString);
PlayerTextDrawShow(i, CratePTD[0]);
if(CrateTime[i] == 0) {
if(CrateModel[i] <= 0) {
format(gString, 120,"%s, a deschis o cutie de test si puteai castiga %d Respect points.", GetName(i),amount);
SCM(i, COLOR_WHITE, gString);
} else {
format(gString, 120,"(( {%s}%s Crate {A9C4E4}- %s opened a box and won %d Respect points. ))", CrateColors[x], CrateName[x], GetName(i),amount, CrateName[x]);
SCMTA(COLOR_CLIENT, gString);
PlayerInfo[i][pExp] += amount;
Update(i, pRP);
}
KillTimer(TimerCratesEx[i]);
CrateModel[i] = -1;
}
}
case 31..40: {
amount = random(10) + x * 10;
format(gString, 75, "~y~%s Premium points~n~~w~~h~you have %d crates.", FormatNumber(amount), totalcrates(i));
PlayerTextDrawSetPreviewModel(i, CratePTD[0], 1275);
PlayerTextDrawSetString(i, CratePTD[1], gString);
PlayerTextDrawShow(i, CratePTD[0]);
if(CrateTime[i] == 0) {
if(CrateModel[i] <= 0) {
format(gString, 120,"%s, a deschis o cutie de test si puteai castiga %d Premium points.", GetName(i),amount);
SCM(i, COLOR_WHITE, gString);
} else {
format(gString, 120,"(( {%s}%s Crate {A9C4E4}- %s opened a box and won %d Premium points. ))", CrateColors[x], CrateName[x], GetName(i),amount);
SCMTA(COLOR_CLIENT, gString);
PlayerInfo[i][pPremiumPoints] += amount;
Update(i, pPremiumPointsx);
}
KillTimer(TimerCratesEx[i]);
CrateModel[i] = -1;
}
}
default: {
amount = random(2000000) + x * 2000000;
format(gString, 65, "~g~%s~n~~w~~h~you have %d crates.", FormatNumber(amount), totalcrates(i));
PlayerTextDrawSetPreviewModel(i, CratePTD[0], 1274);
PlayerTextDrawSetString(i, CratePTD[1], gString);
PlayerTextDrawShow(i, CratePTD[0]);
if(CrateTime[i] == 0) {
if(CrateModel[i] <= 0) {
format(gString, 120,"%s, a deschis o cutie de test si puteai castiga $%s.", GetName(i), FormatNumber(amount));
SCM(i, COLOR_WHITE, gString);
} else {
format(gString, 120,"(( {%s}%s Crate {A9C4E4}- %s opened a box and won {50DB6F}$%s{A9C4E4}. ))", CrateColors[x], CrateName[x], GetName(i), FormatNumber(amount));
SCMTA(COLOR_CLIENT, gString);
GivePlayerCash(i, 1, amount);
}
KillTimer(TimerCratesEx[i]);
CrateModel[i] = -1;
}
}
}
} else {
switch(rand) {
case 0..5: {
amount = RandomEx(30, 250);
format(gString, 65, "Infernus (PREMIUM)~n~~w~~h~you have %d crates.", totalcrates(i));
PlayerTextDrawSetPreviewModel(i, CratePTD[0], 411);
PlayerTextDrawSetString(i, CratePTD[1], gString);
PlayerTextDrawShow(i, CratePTD[0]);
if(CrateTime[i] <= 0) {
if(Iter_Count(MyVehicle[i]) >= GetSlots(i)) { PlayerInfo[i][pCrates][4] ++; save_crates(i); SCM(i, COLOR_LIGHTGREEN, "Nu ai un slot liber."); CrateModel[i] = -1; KillTimer(TimerCratesEx[i]); return true; }
else {
KillTimer(TimerCratesEx[i]);
CrateModel[i] = -1;
GiveVehicle(i, 411, 0, 0, 1, 0, 0);
format(gString, 120, "(( {7556ff}Vehicle Crate {A9C4E4}- %s opened a box and won Infernus PREMIUM. ))", GetName(i));
SCMTA(COLOR_CLIENT, gString);
}
}
}
case 6..33: {
amount = random(20) + 20;
format(gString, 64, "Picador~n~~w~~h~you have %d crates.", totalcrates(i));
PlayerTextDrawSetPreviewModel(i, CratePTD[0], 600);
PlayerTextDrawSetString(i, CratePTD[1], gString);
PlayerTextDrawShow(i, CratePTD[0]);
if(CrateTime[i] == 0) {
if(Iter_Count(MyVehicle[i]) >= GetSlots(i)) { PlayerInfo[i][pCrates][4] ++; save_crates(i); SCM(i, COLOR_LIGHTGREEN, "Nu ai un slot liber."); CrateModel[i] = -1; KillTimer(TimerCratesEx[i]); return true; }
else {
KillTimer(TimerCratesEx[i]);
CrateModel[i] = -1;
GiveVehicle(i, 600, 0, 0, 0, 0, 0);
format(gString, 120,"(( {7556ff}Vehicle Crate {A9C4E4}- %s opened a box and won Picador. ))", GetName(i));
SCMTA(COLOR_CLIENT,gString);
}
}
}
case 34..40: {
format(gString, 65, "hpv1000~n~~w~~h~you have %d crates.", totalcrates(i));
PlayerTextDrawSetPreviewModel(i, CratePTD[0], 523);
PlayerTextDrawSetString(i, CratePTD[1], gString);
PlayerTextDrawShow(i, CratePTD[0]);
if(CrateTime[i] <= 0) {
if(Iter_Count(MyVehicle[i]) >= GetSlots(i)) { PlayerInfo[i][pCrates][4] ++; save_crates(i); SCM(i, COLOR_LIGHTGREEN, "Nu ai un slot liber."); CrateModel[i] = -1; KillTimer(TimerCratesEx[i]); return true; }
else {
KillTimer(TimerCratesEx[i]);
CrateModel[i] = -1;
GiveVehicle(i, 523, 0, 0, 0, 0, 0);
format(gString, 120,"(( {7556ff}Vehicle Crate {A9C4E4}- %s opened a box and won hpv1000. ))", GetName(i));
SCMTA(COLOR_CLIENT, gString);
}
}
}
case 41..46: {
format(gString, 65, "NRG-500 (PREMIUM)~n~~w~~h~you have %d crates.", totalcrates(i));
PlayerTextDrawSetPreviewModel(i, CratePTD[0], 522);
PlayerTextDrawSetString(i, CratePTD[1], gString);
PlayerTextDrawShow(i, CratePTD[0]);
if(CrateTime[i] <= 0) {
if(Iter_Count(MyVehicle[i]) >= GetSlots(i)) { PlayerInfo[i][pCrates][4] ++; save_crates(i); SCM(i, COLOR_LIGHTGREEN, "Nu ai un slot liber."); CrateModel[i] = -1; KillTimer(TimerCratesEx[i]); return true; }
else {
KillTimer(TimerCratesEx[i]);
CrateModel[i] = -1;
GiveVehicle(i, 522, 0, 0, 1, 0, 0);
format(gString, 120,"(( {7556ff}Vehicle Crate {A9C4E4}- %s opened a box and won NRG-500 PREMIUM. ))", GetName(i));
SCMTA(COLOR_CLIENT,gString);
}
}
}
case 47..53: {
format(gString, 65, "ticket (RAINBOW)~n~~w~~h~you have %d crates.", totalcrates(i));
PlayerTextDrawSetPreviewModel(i, CratePTD[0], 1581);
PlayerTextDrawSetString(i, CratePTD[1], gString);
PlayerTextDrawShow(i, CratePTD[0]);
if(CrateTime[i] <= 0) {
KillTimer(TimerCratesEx[i]);
CrateModel[i] = -1;
PlayerInfo[i][pTickete][0] ++;
save_tickete(i);
format(gString, 120,"(( {7556ff}Vehicle Crate {A9C4E4}- %s opened a box and won Rainbow Ticket. ))", GetName(i));
SCMTA(COLOR_CLIENT, gString);
}
}
case 54..66: {
format(gString, 65, "ticket (VIP)~n~~w~~h~you have %d crates.", totalcrates(i));
PlayerTextDrawSetPreviewModel(i, CratePTD[0], 1581);
PlayerTextDrawSetString(i, CratePTD[1], gString);
PlayerTextDrawShow(i, CratePTD[0]);
if(CrateTime[i] <= 0) {
KillTimer(TimerCratesEx[i]);
CrateModel[i] = -1;
PlayerInfo[i][pTickete][1] ++;
save_tickete(i);
format(gString, 120,"(( {7556ff}Vehicle Crate {A9C4E4}- %s opened a box and won Vip Ticket. ))", GetName(i));
SCMTA(COLOR_CLIENT,gString);
}
}
default: {
format(gString, 65, "Savanna~n~~w~~h~you have %d crates.", totalcrates(i));
PlayerTextDrawSetPreviewModel(i, CratePTD[0], 567);
PlayerTextDrawSetString(i, CratePTD[1], gString);
PlayerTextDrawShow(i, CratePTD[0]);
if(CrateTime[i] <= 0) {
if(Iter_Count(MyVehicle[i]) >= GetSlots(i)) { PlayerInfo[i][pCrates][4] ++; save_crates(i); SCM(i, COLOR_LIGHTGREEN, "Nu ai un slot liber."); CrateModel[i] = -1; KillTimer(TimerCratesEx[i]); return true; }
else {
KillTimer(TimerCratesEx[i]);
CrateModel[i] = -1;
GiveVehicle(i, 567, 0, 0, 0, 0, 0);
format(gString, 120,"(( {7556ff}Vehicle Crate {A9C4E4}- %s opened a box and won Savanna. ))", GetName(i));
SCMTA(COLOR_CLIENT, gString);
}
}
}
}
}
return true;
}
Link to comment
Share on other sites
16 answers to this question
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.