- Регистрация
- 30 Янв 2019
- Сообщения
- 17
- Лучшие ответы
- 1
- Репутация
- 1
Вот ошибка:
Вот сам код:C:\Users\Àäìèí\Desktop\Ìîäû\NameRp\gamemodes\new.pwn(46160) : warning: recursion in ShowItog: call from ExitBone C:\Users\Àäìèí\Desktop\Ìîäû\NameRp\gamemodes\new.pwn(46137)
Disable recursion warning: #pragma disablerecursion
PHP:
stock ExitBone(playerid)
{
new null[2] = 0;
if(GetPVarInt(playerid,"BoneStol_") && BoneInfo[GetPVarInt(playerid,"BoneStol")-1][GameStart] <= 0)
{
pInfo[playerid][pCash]+=BoneInfo[GetPVarInt(playerid,"BoneStol")-1][Bet];
BoneInfo[GetPVarInt(playerid,"BoneStol")-1][bBank]-=BoneInfo[GetPVarInt(playerid,"BoneStol")-1][Bet];
}
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(GetPVarInt(i,"BoneStol") == GetPVarInt(playerid,"BoneStol") && i != playerid && GetPVarInt(i,"BoneStol_") == 1) null[0]++;
if(GetPVarInt(i,"BoneStol") == GetPVarInt(playerid,"BoneStol") && i != playerid && GetPVarInt(i,"BoneStol_") > 1) null[1]++;
}
if(null[0] == 0 && null[1] > 0) ShowItog(GetPVarInt(playerid,"BoneStol")-1);
if(BoneInfo[GetPVarInt(playerid,"BoneStol")-1][Crupie] == playerid) BoneInfo[GetPVarInt(playerid,"BoneStol")-1][Crupie] = INVALID_PLAYER_ID;
for(new i; i != 4; i++) TextDrawHideForPlayer(playerid,Bone[i]), PlayerTextDrawHide(playerid,PlayerBone[playerid][i]);
for(new i_ = 0; i_ != 5; i_++) if(BoneInfo[GetPVarInt(playerid,"BoneStol")-1][Gamer][i_] == playerid) BoneInfo[GetPVarInt(playerid,"BoneStol")-1][Gamer][i_] = INVALID_PLAYER_ID;
UpdateBone(GetPVarInt(playerid,"BoneStol")-1);
DeletePVar(playerid,"BoneStol");
DeletePVar(playerid,"BoneStol_");
CancelSelectTextDraw(playerid);
return true;
}
stock ShowItog(idx)
{
new itog[3] = -1; itog[0] = -1; itog[1] = -1; itog[2] = -1;
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(GetPVarInt(i,"BoneStol")-1 == idx && GetPVarInt(i,"BoneStol_") > 1 && GetPVarInt(i,"BoneStol_") > itog[0]) itog[0] = GetPVarInt(i,"BoneStol_"), itog[1] = i;
if(GetPVarInt(i,"BoneStol")-1 == idx && GetPVarInt(i,"BoneStol_") > 1 && i != itog[1] && GetPVarInt(i,"BoneStol_") == itog[0]) itog[2] = i;
}
if(itog[2] > -1)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(GetPVarInt(i,"BoneStol")-1 == idx && GetPVarInt(i,"BoneStol_") > 1 && GetPVarInt(i,"BoneStol_") == itog[0]) SetPVarInt(i,"BoneStol_",1), BoneInfo[idx][GameStart] = 30, SCM(i,0x4B00B0AA,"Âû ïîïàëè â ñëåäóþùèé ðàóíä. Ó âàñ åñòü 30 ñåêóíä, ÷òîáû áðîñèòü êîñòè");
else if(GetPVarInt(i,"BoneStol")-1 == idx) DeletePVar(i,"BoneStol_");
}
UpdateBone(idx);
}
else if(itog[1] > -1)
{
new string[10];
format(string,128,"Èãðà îêîí÷åíà. Ïîáåäèòåëü èãðû: %s",pInfo[itog[1]][pName]);
if(BoneInfo[idx][Crupie] != INVALID_PLAYER_ID) GivePlayerMoney(BoneInfo[idx][Crupie],1500);
GivePlayerMoney(itog[1], BoneInfo[idx][bBank]-(BoneInfo[idx][bBank]/10));
BoneInfo[idx][GameStart] = 0;
BoneInfo[idx][Bet] = 0;
BoneInfo[idx][bBank] = 0;
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(GetPVarInt(i,"BoneStol")-1 == idx)
{
SCM(i,0x4B00B0AA,string);
DeletePVar(i,"BoneStol_");
}
}
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(GetPVarInt(i,"BoneStol")-1 == idx && IsPlayerNearBone(i) != idx) ExitBone(i);
}
UpdateBone(idx);
}
return true;
}