Tenнas mal colocada una variable, le editй un par de cosas de los ifs para que sea mбs corto el cуdigo (aunque no influya) y la variable players era disminuida luego de que se ejecutara el primer textdraw cuando en realidad tendrнa que haber sido antes.
pawn Код:
new string[128];
if(killerid != INVALID_PLAYER_ID && SurvivalGameKill[playerid] == 1)
{
new DerbyPlayerName[MAX_PLAYER_NAME];
GetPlayerName(playerid, DerbyPlayerName, sizeof(DerbyPlayerName));
format(Byts, sizeof(Byts), "» %s fue eliminado del Survival {FFFF80}[Puesto: %d]",DerbyPlayerName,players);
SendClientMessageToAll(0x008000C8, Byts);
players--;
format(string2, sizeof(string2), "deathmatchers # ~r~~h~%d",players);
TextDrawSetString(Participantes,string2);
TextDrawShowForAll(Participantes);
SurvivalGameKill[playerid] = 0;
if(players == 1)
{
for(new i=0; i<MAX_PLAYERS; i++)
{
if (IsPlayerConnected(i) && SurvivalGameKill[i] == 1)
{
new winnername[MAX_PLAYER_NAME];
GetPlayerName(i,winnername, sizeof(winnername));
RewardCalc(i,100,1000);
format(string, sizeof(string), "» %s Gana el Survival {80FF00}[Premio: +$%d]", winnername, reward);
SendClientMessageToAll(0x008000C8, string);
format(Byts, sizeof(Byts), "Win # ~b~~h~%s",winnername);
TextDrawSetString(Participantes,Byts);
TextDrawShowForAll(Participantes);
GivePlayerMoney(i,reward);
SetPlayerVirtualWorld(i,0);
SetPlayerInterior(playerid, 0);
SetPlayerPos(i, spawnX, spawnY, spawnZ);
GameTextForPlayer(i,"~g~Ganaste el ~y~Survival",4000,3);
TimeKillEvento = SetTimer("ComandoListo",30000,0);
SetTimer("HideWin",5000,0);
players = 0;
break;
}
}
}
}