10.09.2013, 11:08
Hello, I got a little weird problem/bug
I'm making a minigame, and now I'm busy with the 'stock LeaveGame' function.
Here's the code:
and this:
Well, so I go ingame, in the game, die, and then the function should be called, so normally it should give me the messages
But it doesn't do that... So I thought, okay there's something wrong with:
But when I added the print line, and I looked in the server log I saw that the array was 0, however the messages weren't called...
Do you know what could be wrong?
Thanks in advance
I'm making a minigame, and now I'm busy with the 'stock LeaveGame' function.
Here's the code:
pawn Код:
stock LeaveCaveGame(playerid)
{
SInfo[CaveCount] --;
PInfo[playerid][CaveGame] = 0;
printf("%d leavecavegame called", SInfo[CaveCount]);
if(SInfo[CaveCount] == 0)
{
new string [256], PlayerName[MAX_PLAYER_NAME];
GetPlayerName(playerid, PlayerName,sizeof PlayerName);
format (string, sizeof string, "[CAVE]The Game has ended, %s stayed alive for %s, server record: lala, typer /cave to try it yourself", PlayerName, ReturnSToM(SInfo[CaveUpdateCount]));
SendClientMessageToAll(COLOR_ORANGE, string);
SendClientMessage(playerid,COLOR_ORANGE ,"[CAVE]You won in blabla, your best: blabla");
SInfo[CaveRunning] = 0;
SInfo[CaveJoining] = 0;
KillTimer(SInfo[CaveUpdateTimer]);
}
else if(SInfo[CaveCount] > 0)
{
SendClientMessage(playerid,COLOR_ORANGE ,"[CAVE]... has dropped out blabla");
}
return 1;
}
pawn Код:
LeaveCaveGame(playerid);//OnPlayerDeath
pawn Код:
SendClientMessageToAll(COLOR_ORANGE, string);
SendClientMessage(playerid,COLOR_ORANGE ,"[CAVE]You won in blabla, your best: blabla");
pawn Код:
SInfo[CaveCount]
Do you know what could be wrong?
Thanks in advance