Рекомендованные сообщения



Не найдено.

1 post in this topic

qq all, ошибка : warning: recursionin in ExitBone: call from ShowResult 
 

Спойлер

 

C:\Users\BLABLA\Desktop\BLABLA\gamemodes\BLABLA.pwn(12520) : warning: recursion in ExitBone: call from ShowResult C:\Users\BLABLA\Desktop\BLABLA\gamemodes\BLABLA.pwn(12430)
Disable recursion warning: #pragma disablerecursion or #pragma warning disable 238
Pawn compiler 3.2.3664              Copyright (c) 1997-2017, ITB CompuPhase


1 Warning.
 


 

Спойлер

stock ExitBone(playerid)
{
    new null[2] = 0;
    if(GetPVarInt(playerid,"playing_casino_ex") && TableInfo[GetPVarInt(playerid,"playing_casino")-1][GameStart] <= 0)
    {
        TransferMoney(-1, playerid, TableInfo[GetPVarInt(playerid,"playing_casino")-1][Bet], "âîçâðàò ñòàâêè");
        TableInfo[GetPVarInt(playerid,"playing_casino")-1][Bank]-=TableInfo[GetPVarInt(playerid,"playing_casino")-1][Bet];
    }
    foreach(new i: Player)
    {
        if(GetPVarInt(i,"playing_casino") == GetPVarInt(playerid,"playing_casino") && i != playerid && GetPVarInt(i,"playing_casino_ex") == 1) null[0]++;
        if(GetPVarInt(i,"playing_casino") == GetPVarInt(playerid,"playing_casino") && i != playerid && GetPVarInt(i,"playing_casino_ex") > 1) null[1]++;
    }
    if(null[0] == 0 && null[1] > 0) ShowResult(GetPVarInt(playerid,"playing_casino")-1);
    if(TableInfo[GetPVarInt(playerid,"playing_casino")-1][Crupie] == playerid) TableInfo[GetPVarInt(playerid,"playing_casino")-1][Crupie] = INVALID_PLAYER_ID;
    for(new i; i < 11; i++) TextDrawHideForPlayer(playerid, Bone); 
    for(new i; i < 6; i++) PlayerTextDrawHide(playerid, PlayerBone[playerid]);
    for(new i_ = 0; i_ != 5; i_++) if(TableInfo[GetPVarInt(playerid,"playing_casino")-1][Player][i_] == playerid) TableInfo[GetPVarInt(playerid,"playing_casino")-1][Player][i_] = INVALID_PLAYER_ID;
    UpdateBone(GetPVarInt(playerid,"playing_casino")-1);
    DeletePVar(playerid,"playing_casino");
    DeletePVar(playerid,"playing_casino_ex");
    CancelSelectTextDraw(playerid);
    return true;
}

 

Спойлер

forward ShowResult(idx);
public ShowResult(idx)
{
    new itog[3] = -1,string[128]; itog[0] = -1; itog[1] = -1; itog[2] = -1;
    foreach(new i: Player)
    {
        if(GetPVarInt(i,"playing_casino")-1 == idx && GetPVarInt(i,"playing_casino_ex") > 1 && GetPVarInt(i,"playing_casino_ex") > itog[0]) itog[0] = GetPVarInt(i,"playing_casino_ex"), itog[1] = i;
        if(GetPVarInt(i,"playing_casino")-1 == idx && GetPVarInt(i,"playing_casino_ex") > 1 && i != itog[1] && GetPVarInt(i,"playing_casino_ex") == itog[0]) itog[2] = i;
    }
    if(itog[2] > -1)
    {
        foreach(new i: Player)
        {
            if(GetPVarInt(i,"playing_casino")-1 == idx && GetPVarInt(i,"playing_casino_ex") > 1 && GetPVarInt(i,"playing_casino_ex") == itog[0]) SetPVarInt(i,"playing_casino_ex",1), TableInfo[idx][GameStart] = 30, SendClientMessage(i,0x4B00B0AA,"Âû ïîïàëè â ñëåäóþùèé ðàóíä. Ó âàñ åñòü 30 ñåêóíä, ÷òîáû áðîñèòü êîñòè");
            else if(GetPVarInt(i,"playing_casino")-1 == idx) DeletePVar(i,"playing_casino_ex");
        }
        UpdateBone(idx);
    }
    else if(itog[1] > -1)
    {
        new winsum;
        winsum = TableInfo[idx][Bank]-floatround(TableInfo[idx][Bank]*(CASINO_WIN_PERCENT+CRUPIE_WIN_PERCENT));
        format(string,128,"%s ïîáåæäàåò ñ êîëè÷åñòâîì î÷êîâ: {FFFFFF}%i",pInfo[itog[1]][pName],itog[0]);
        if(TableInfo[idx][Crupie] != INVALID_PLAYER_ID) TransferMoney(-1, TableInfo[idx][Crupie], floatround(TableInfo[idx][Bank]*CRUPIE_WIN_PERCENT));
        TransferMoney(-1, itog[1], winsum);
        GiveBizMoney(73, floatround(TableInfo[idx][Bank]*CASINO_WIN_PERCENT), 0);
        SendMes(TableInfo[idx][Crupie], COLOR_LIGHTGREEN, "Â ðåçóëüòàòå ïðîøëîé èãðû âàì áûë âûäàí ïðîöåíò îò ñóììû âûèãðûøà: {FFFFFF}%d$", floatround(TableInfo[idx][Bank]*CRUPIE_WIN_PERCENT));
        SendMes(itog[1], COLOR_LIGHTGREEN, "Âàø âûéãðûø: {FFFFFF}+%d$", winsum-TableInfo[idx][Bet]);
        TableInfo[idx][GameStart] = 0;
        TableInfo[idx][Bet] = 0;
        TableInfo[idx][Bank] = 0;
        foreach(new i: Player)
        {
            if(GetPVarInt(i,"playing_casino")-1 == idx)
            {
                SendClientMessage(i, COLOR_ORANGE, string);
                DeletePVar(i,"playing_casino_ex");
            }
        }
        foreach(new i: Player)
        {
            if(GetPVarInt(i,"playing_casino")-1 == idx && IsPlayerNearTable(i) != idx) ExitBone(i);
        }
        UpdateBone(idx);
    }
    return true;
}

 

Edited by TheRoman

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  
Followers 0

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • warrion4ik
      By warrion4ik
      При телепорте по метке она тепает под текстуры и приходится перетелепортироваться, как это можно исправить?
      Видео: https://youtu.be/FLjer8lfGc0