- 0
problema crates
-
Similar Content
-
- 0 replies
- 369 views
-
- 0 answers
- 51 views
-
- 6 replies
- 333 views
-
- 4 replies
- 287 views
-
- 1 answer
- 593 views
-
-
Recently Browsing 0 members
- No registered users viewing this page.
Question
ixnel1337
primesc o eroare cand deschid un tip de crate, acesta fiind vehicle crate.
[Error] SetTimer(Ex): There was a problem in calling crate_openning: Array index out of bounds ( in consola )
cand deschid alt tip de crate merge perfect
ptask crate_openning[1000](playerid)
{
new randomVehicles_td1,
randomVehicles_td2,
randomVehicles_td3,
randomVehicles_td4,
randomVehicles_td5,
randomSkins_td1,
randomSkins_td2,
randomSkins_td3,
randomSkins_td4,
randomSkins_td5,
vehicle_reward,
skins_reward;
if(playerVariables[playerid][pCrate10xVehiclesSkill] == 1) randomVehicles_td1 = random(10);
else if(playerVariables[playerid][pCrate10xVehiclesSkill] == 2) randomVehicles_td1 = random(12);
else if(playerVariables[playerid][pCrate10xVehiclesSkill] == 3) randomVehicles_td1 = random(15);
else if(playerVariables[playerid][pCrate10xVehiclesSkill] == 4) randomVehicles_td1 = random(18);
else if(playerVariables[playerid][pCrate10xVehiclesSkill] == 5) randomVehicles_td1 = random(20);
if(playerVariables[playerid][pCrate10xVehiclesSkill] == 1) randomVehicles_td2 = random(10);
else if(playerVariables[playerid][pCrate10xVehiclesSkill] == 2) randomVehicles_td2 = random(12);
else if(playerVariables[playerid][pCrate10xVehiclesSkill] == 3) randomVehicles_td2 = random(15);
else if(playerVariables[playerid][pCrate10xVehiclesSkill] == 4) randomVehicles_td2 = random(18);
else if(playerVariables[playerid][pCrate10xVehiclesSkill] == 5) randomVehicles_td2 = random(20);
if(playerVariables[playerid][pCrate10xVehiclesSkill] == 1) randomVehicles_td3 = random(10);
else if(playerVariables[playerid][pCrate10xVehiclesSkill] == 2) randomVehicles_td3 = random(12);
else if(playerVariables[playerid][pCrate10xVehiclesSkill] == 3) randomVehicles_td3 = random(15);
else if(playerVariables[playerid][pCrate10xVehiclesSkill] == 4) randomVehicles_td3 = random(18);
else if(playerVariables[playerid][pCrate10xVehiclesSkill] == 5) randomVehicles_td3 = random(20);
if(playerVariables[playerid][pCrate10xVehiclesSkill] == 1) randomVehicles_td4 = random(10);
else if(playerVariables[playerid][pCrate10xVehiclesSkill] == 2) randomVehicles_td4 = random(12);
else if(playerVariables[playerid][pCrate10xVehiclesSkill] == 3) randomVehicles_td4 = random(15);
else if(playerVariables[playerid][pCrate10xVehiclesSkill] == 4) randomVehicles_td4 = random(18);
else if(playerVariables[playerid][pCrate10xVehiclesSkill] == 5) randomVehicles_td4 = random(20);
if(playerVariables[playerid][pCrate10xVehiclesSkill] == 1) randomVehicles_td5 = random(10);
else if(playerVariables[playerid][pCrate10xVehiclesSkill] == 2) randomVehicles_td5 = random(12);
else if(playerVariables[playerid][pCrate10xVehiclesSkill] == 3) randomVehicles_td5 = random(15);
else if(playerVariables[playerid][pCrate10xVehiclesSkill] == 4) randomVehicles_td5 = random(18);
else if(playerVariables[playerid][pCrate10xVehiclesSkill] == 5) randomVehicles_td5 = random(20);
if(playerVariables[playerid][pCrate10xSkinsSkill] == 1) randomSkins_td1 = random(10);
else if(playerVariables[playerid][pCrate10xSkinsSkill] == 2) randomSkins_td1 = random(12);
else if(playerVariables[playerid][pCrate10xSkinsSkill] == 3) randomSkins_td1 = random(15);
else if(playerVariables[playerid][pCrate10xSkinsSkill] == 4) randomSkins_td1 = random(18);
else if(playerVariables[playerid][pCrate10xSkinsSkill] == 5) randomSkins_td1 = random(20);
if(playerVariables[playerid][pCrate10xSkinsSkill] == 1) randomSkins_td2 = random(10);
else if(playerVariables[playerid][pCrate10xSkinsSkill] == 2) randomSkins_td2 = random(12);
else if(playerVariables[playerid][pCrate10xSkinsSkill] == 3) randomSkins_td2 = random(15);
else if(playerVariables[playerid][pCrate10xSkinsSkill] == 4) randomSkins_td2 = random(18);
else if(playerVariables[playerid][pCrate10xSkinsSkill] == 5) randomSkins_td2 = random(20);
if(playerVariables[playerid][pCrate10xSkinsSkill] == 1) randomSkins_td3 = random(10);
else if(playerVariables[playerid][pCrate10xSkinsSkill] == 2) randomSkins_td3 = random(12);
else if(playerVariables[playerid][pCrate10xSkinsSkill] == 3) randomSkins_td3 = random(15);
else if(playerVariables[playerid][pCrate10xSkinsSkill] == 4) randomSkins_td3 = random(18);
else if(playerVariables[playerid][pCrate10xSkinsSkill] == 5) randomSkins_td3 = random(20);
if(playerVariables[playerid][pCrate10xSkinsSkill] == 1) randomSkins_td4 = random(10);
else if(playerVariables[playerid][pCrate10xSkinsSkill] == 2) randomSkins_td4 = random(12);
else if(playerVariables[playerid][pCrate10xSkinsSkill] == 3) randomSkins_td4 = random(15);
else if(playerVariables[playerid][pCrate10xSkinsSkill] == 4) randomSkins_td4 = random(18);
else if(playerVariables[playerid][pCrate10xSkinsSkill] == 5) randomSkins_td4 = random(20);
if(playerVariables[playerid][pCrate10xSkinsSkill] == 1) randomSkins_td5 = random(10);
else if(playerVariables[playerid][pCrate10xSkinsSkill] == 2) randomSkins_td5 = random(12);
else if(playerVariables[playerid][pCrate10xSkinsSkill] == 3) randomSkins_td5 = random(15);
else if(playerVariables[playerid][pCrate10xSkinsSkill] == 4) randomSkins_td5 = random(18);
else if(playerVariables[playerid][pCrate10xSkinsSkill] == 5) randomSkins_td5 = random(20);
switch(player_selected_crate[playerid])
{
case 1: {
if(crate_timer[playerid] > 0)
{
crate_timer[playerid] --;
gString[0] = EOS;
format(gString, sizeof gString, "Crate openning time: ~y~%d~w~ seconds", crate_timer[playerid]);
PlayerTextDrawSetString(playerid, ptd_crates[11], gString);
PlayerTextDrawSetPreviewModel(playerid, ptd_crates[3], getCrateVehiclesModel(playerid, randomVehicles_td1)), vehicle_reward = getCrateVehiclesModel(playerid, randomVehicles_td1);
PlayerTextDrawSetPreviewModel(playerid, ptd_crates[6], getCrateVehiclesModel(playerid, randomVehicles_td2));
PlayerTextDrawSetPreviewModel(playerid, ptd_crates[7], getCrateVehiclesModel(playerid, randomVehicles_td3));
PlayerTextDrawSetPreviewModel(playerid, ptd_crates[8], getCrateVehiclesModel(playerid, randomVehicles_td4));
PlayerTextDrawSetPreviewModel(playerid, ptd_crates[9], getCrateVehiclesModel(playerid, randomVehicles_td5));
PlayerTextDrawShow(playerid, ptd_crates[3]);
PlayerTextDrawShow(playerid, ptd_crates[6]); PlayerTextDrawShow(playerid, ptd_crates[7]);
PlayerTextDrawShow(playerid, ptd_crates[8]); PlayerTextDrawShow(playerid, ptd_crates[9]);
gString[0] = EOS;
format(gString, sizeof gString, "%s", vehNames[vehicle_reward-400]);
PlayerTextDrawSetString(playerid, ptd_crates[4], gString);
if(crate_timer[playerid] <= 0)
{
if(GetPlayerVehicles(playerid) >= playerVariables[playerid][pMaxVehicles]) {
SCM(playerid, COLOR_GREY, "Nu ai primit vehiculul deoarece nu ai un slot liber.");
return true;
}
gString[0] = (EOS);
format(gString, sizeof gString, "* You openned 'Crate 10x Vehicles' and won vehicle %s. Congrulations!", vehNames[vehicle_reward-400]);
SendClientMessage(playerid, COLOR_YELLOW, gString);
gString[0] = (EOS);
format(gString, sizeof gString, "(( %s openned Crate 10x Vehicles and won vehicle %s. Congrulations! ))", GetName(playerid), vehNames[vehicle_reward-400]);
SendClientMessageToAll(COLOR_ANNOUNCE, gString);
new ds = random(sizeof(ds_pos));
GivePlayerVehicle(playerid, vehicle_reward, ds_pos[ds][0], ds_pos[ds][1], ds_pos[ds][2], 90.0, 1);
playerVariables[playerid][pCrate10xVehicles] --;
playerVariables[playerid][pCrate10xVehiclesOpen] ++;
if(playerVariables[playerid][pCrate10xVehiclesOpen] >= playerVariables[playerid][pCrate10xVehiclesSkill] * 10) {
playerVariables[playerid][pCrate10xVehiclesSkill] ++;
SCM(playerid, COLOR_YELLOW, "Ai avansat la Skill %d pentru acest crate. Ti-au fost adaugate vehicule noi!", playerVariables[playerid][pCrate10xVehiclesSkill]);
}
gQuery[0] = EOS;
mysql_format(SQL, gQuery, sizeof(gQuery), "update `server_accounts` set `Crate10xVehicles` = %d, `Crate10xVehiclesOpen` = %d, `Crate10xVehiclesSkill` = %d where `playerID` = '%d'", playerVariables[playerid][pCrate10xVehicles], playerVariables[playerid][pCrate10xVehiclesOpen], playerVariables[playerid][pCrate10xVehiclesSkill], playerVariables[playerid][pSQLID]);
mysql_tquery(SQL, gQuery, "", "");
return true;
}
}
}
case 2: {
if(crate_timer[playerid] > 0)
{
crate_timer[playerid] --;
gString[0] = EOS;
format(gString, sizeof gString, "Crate openning time: ~y~%d~w~ seconds", crate_timer[playerid]);
PlayerTextDrawSetString(playerid, ptd_crates[11], gString);
PlayerTextDrawSetPreviewModel(playerid, ptd_crates[3], getCrateSkinsModel(playerid, randomSkins_td1)), skins_reward = getCrateSkinsModel(playerid, randomSkins_td1);
PlayerTextDrawSetPreviewModel(playerid, ptd_crates[6], getCrateSkinsModel(playerid, randomSkins_td2));
PlayerTextDrawSetPreviewModel(playerid, ptd_crates[7], getCrateSkinsModel(playerid, randomSkins_td3));
PlayerTextDrawSetPreviewModel(playerid, ptd_crates[8], getCrateSkinsModel(playerid, randomSkins_td4));
PlayerTextDrawSetPreviewModel(playerid, ptd_crates[9], getCrateSkinsModel(playerid, randomSkins_td5));
PlayerTextDrawShow(playerid, ptd_crates[3]);
PlayerTextDrawShow(playerid, ptd_crates[6]); PlayerTextDrawShow(playerid, ptd_crates[7]);
PlayerTextDrawShow(playerid, ptd_crates[8]); PlayerTextDrawShow(playerid, ptd_crates[9]);
gString[0] = EOS;
format(gString, sizeof gString, "Skin %d (%s%s~w~)", skins_reward, skin_td_colors[GetSkinRarity(skins_reward)], skin_rarity[GetSkinRarity(skins_reward)]);
PlayerTextDrawSetString(playerid, ptd_crates[4], gString);
if(crate_timer[playerid] <= 0)
{
if(GetPlayerSkins(playerid) >= MAX_SKINS_OWNED)
return SCM(playerid, COLOR_GREY, "Error: "EMBED_WHITE"Ai deja maxim-ul de skin-uri.");
if(have_this_skin(playerid, skins_reward))
{
SCM(playerid, COLOR_LGREEN, "* Nu ai primit skin-ul #%d deoarece il ai deja!", skins_reward);
return true;
}
gString[0] = (EOS);
format(gString, sizeof gString, "* You openned 'Crate 10x Skins' and won Skin %d ({%s}%s{FFFF00}). Congrulations!", skins_reward, skin_colors[GetSkinRarity(skins_reward)], skin_rarity[GetSkinRarity(skins_reward)]);
SendClientMessage(playerid, COLOR_YELLOW, gString);
gString[0] = (EOS);
format(gString, sizeof gString, "(( %s openned Crate 10x Skins and won Skin %d ({%s}%s"EMBED_ANNOUNCE"). Congrulations! ))", GetName(playerid), skins_reward, skin_colors[GetSkinRarity(skins_reward)], skin_rarity[GetSkinRarity(skins_reward)]);
SendClientMessageToAll(COLOR_ANNOUNCE, gString);
GivePlayerSkin(playerid, skins_reward);
playerVariables[playerid][pCrate10xSkins] --;
playerVariables[playerid][pCrate10xSkinsOpen] ++;
if(playerVariables[playerid][pCrate10xSkinsOpen] >= playerVariables[playerid][pCrate10xSkinsSkill] * 10) {
playerVariables[playerid][pCrate10xSkinsSkill] ++;
SCM(playerid, COLOR_YELLOW, "Ai avansat la Skill %d pentru acest crate. Ti-au fost adaugate skin-uri noi!", playerVariables[playerid][pCrate10xSkinsSkill]);
}
gQuery[0] = EOS;
mysql_format(SQL, gQuery, sizeof(gQuery), "update `server_accounts` set `Crate10xSkins` = %d, `Crate10xSkinsOpen` = %d, `Crate10xSkinsSkill` = %d where `playerID` = '%d'", playerVariables[playerid][pCrate10xSkins], playerVariables[playerid][pCrate10xSkinsOpen], playerVariables[playerid][pCrate10xSkinsSkill], playerVariables[playerid][pSQLID]);
mysql_tquery(SQL, gQuery, "", "");
return true;
}
}
}
}
return true;
}
daca ma poate ajuta cnv ms
14 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.