nao funciona direito -
iTzDemon - 06.10.2013
Eu tentei de todas as maneiras mas continua a nao mandar as msg e a remover da team
pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
playersconnected--;
new string[999];
if(reason == 0)
{
if(TeamAlien[playerid] == 1) TeamAlien[playerid] = 0, Aliens--;
if(TeamHuman[playerid] == 1) TeamHuman[playerid] = 0; Humans--;
format(string, sizeof(string), "O jogador {ffffff}%s {2CF52C}[ID:{ffffff}%d{2CF52C}] caiu/crashou do servidor.[{ffffff}%d/50{2CF52C}]", GetPlayerNameEx(playerid),playerid,playersconnected);
SendClientMessageToAll(COLOR_GREEN, string);
playersconnected--;
SendDeathMessage(INVALID_PLAYER_ID, playerid, 201);
}
else if(reason == 1)
{
if(TeamAlien[playerid] == 1) TeamAlien[playerid] = 0, Aliens--;
if(TeamHuman[playerid] == 1) TeamHuman[playerid] = 0; Humans--;
format(string, sizeof(string), "O jogador {ffffff}%s {2CF52C}[ID:{ffffff}%d{2CF52C}] abandonou o servidor.[{ffffff}%d/50{2CF52C}]", GetPlayerNameEx(playerid),playerid,playersconnected);
SendClientMessageToAll(COLOR_GREEN, string);
SendDeathMessage(INVALID_PLAYER_ID, playerid, 201);
return 1;
}
MySQL_SaveAccount(playerid);
return 1;
}
Re: nao funciona direito -
bruxo00 - 06.10.2013
String 999, WTF
Re: nao funciona direito -
ThuuGLif3 - 06.10.2013
pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
playersconnected--;
new string[128];
if(reason == 0)
{
if(TeamAlien[playerid] == 1) TeamAlien[playerid] = 0, Aliens--;
if(TeamHuman[playerid] == 1) TeamHuman[playerid] = 0; Humans--;
format(string, sizeof(string), "O jogador {ffffff}%s {2CF52C}[ID:{ffffff}%d{2CF52C}] caiu/crashou do servidor.[{ffffff}%d/50{2CF52C}]", GetPlayerNameEx(playerid),playerid,playersconnected);
SendClientMessageToAll(COLOR_GREEN, string);
playersconnected--;
SendDeathMessage(INVALID_PLAYER_ID, playerid, 201);
}
else if(reason == 1)
{
if(TeamAlien[playerid] == 1) TeamAlien[playerid] = 0, Aliens--;
if(TeamHuman[playerid] == 1) TeamHuman[playerid] = 0; Humans--;
format(string, sizeof(string), "O jogador {ffffff}%s {2CF52C}[ID:{ffffff}%d{2CF52C}] abandonou o servidor.[{ffffff}%d/50{2CF52C}]", GetPlayerNameEx(playerid),playerid,playersconnected);
SendClientMessageToAll(COLOR_GREEN, string);
SendDeathMessage(INVALID_PLAYER_ID, playerid, 201);
return 1;
}
MySQL_SaveAccount(playerid);
return 1;
}
Re: nao funciona direito -
zSuYaNw - 06.10.2013
pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
static
string[128]
;
if(!reason)
{
format(string, sizeof(string), "O jogador {ffffff}%s {2CF52C}[ID:{ffffff}%d{2CF52C}] caiu/crashou do servidor.[{ffffff}%d/50{2CF52C}]", GetPlayerNameEx(playerid),playerid,playersconnected);
SendClientMessageToAll(COLOR_GREEN, string);
}
if(reason == 1)
{
format(string, sizeof(string), "O jogador {ffffff}%s {2CF52C}[ID:{ffffff}%d{2CF52C}] abandonou o servidor.[{ffffff}%d/50{2CF52C}]", GetPlayerNameEx(playerid),playerid,playersconnected);
SendClientMessageToAll(COLOR_GREEN, string);
return 1;
}
if(TeamAlien[playerid] == 1) TeamAlien[playerid] = 0, Aliens--;
if(TeamHuman[playerid] == 1) TeamHuman[playerid] = 0; Humans--;
SendDeathMessage(INVALID_PLAYER_ID, playerid, 201);
playersconnected--;
MySQL_SaveAccount(playerid);
return 1;
}
Ou
pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
static
string[128]
;
if(!reason)format(string, sizeof(string), "O jogador {ffffff}%s {2CF52C}[ID:{ffffff}%d{2CF52C}] caiu/crashou do servidor.[{ffffff}%d/50{2CF52C}]", GetPlayerNameEx(playerid),playerid,playersconnected);
if(reason)format(string, sizeof(string), "O jogador {ffffff}%s {2CF52C}[ID:{ffffff}%d{2CF52C}] abandonou o servidor.[{ffffff}%d/50{2CF52C}]", GetPlayerNameEx(playerid),playerid,playersconnected);
SendClientMessageToAll(COLOR_GREEN, string);
TeamAlien[playerid] = (TeamAlien[playerid] ? (TeamAlien[playerid] = 0, Aliens--) : (TeamAlien[playerid]));
TeamHuman[playerid] = (TeamHuman[playerid] ? (TeamHuman[playerid] = 0, Humans--) : (TeamHuman[playerid]));
SendDeathMessage(INVALID_PLAYER_ID, playerid, 201);
playersconnected--;
MySQL_SaveAccount(playerid);
return 1;
}
Re: nao funciona direito -
PT - 06.10.2013
se nenhuma acima der tenta
pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
playersconnected--;
if(TeamAlien[playerid] == 1) TeamAlien[playerid] = 0, Aliens--;
if(TeamHuman[playerid] == 1) TeamHuman[playerid] = 0, Humans--;
SendDeathMessage(INVALID_PLAYER_ID, playerid, 201);
MySQL_SaveAccount(playerid);
new ptString[120];
switch(reason)
{
case 0: format(ptString, sizeof ptString, "O jogador {ffffff}%s {2CF52C}[ID:{ffffff}%d{2CF52C}] caiu/crashou do servidor.[{ffffff}%d/50{2CF52C}]", GetPlayerNameEx(playerid),playerid,playersconnected);
case 1: format(ptString, sizeof ptString, "O jogador {ffffff}%s {2CF52C}[ID:{ffffff}%d{2CF52C}] abandonou o servidor.[{ffffff}%d/50{2CF52C}]", GetPlayerNameEx(playerid),playerid,playersconnected);
//case 2: format(ptString, sizeof ptString, "%s saiu. (Kickado/Banido)", GetPlayerNameEx(playerid)); esta faltando esta opcao
}
SendClientMessageToAll(COLOR_GREEN, ptString);
return 1;
}
Re: nao funciona direito -
Zivo - 06.10.2013
Tenho certeza que esta darб certo:
pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
new string[256];
playersconnected--;
MySQL_SaveAccount(playerid);
if(reason == 0)
{
if(TeamAlien[playerid] == 1)
{
TeamAlien[playerid] = 0;
Aliens--;
}
if(TeamHuman[playerid] == 1)
{
TeamHuman[playerid] = 0;
Humans--;
}
format(string, sizeof(string), "O jogador {ffffff}%s {2CF52C}[ID:{ffffff}%d{2CF52C}] caiu/crashou do servidor.[{ffffff}%d/50{2CF52C}]", GetPlayerNameEx(playerid),playerid,playersconnected);
SendClientMessageToAll(COLOR_GREEN, string);
SendDeathMessage(INVALID_PLAYER_ID, playerid, 201);
return 1;
}
if(reason == 1)
{
if(TeamAlien[playerid] == 1)
{
TeamAlien[playerid] = 0;
Aliens--;
}
if(TeamHuman[playerid] == 1)
{
TeamHuman[playerid] = 0;
Humans--;
}
format(string, sizeof(string), "O jogador {ffffff}%s {2CF52C}[ID:{ffffff}%d{2CF52C}] abandonou o servidor.[{ffffff}%d/50{2CF52C}]", GetPlayerNameEx(playerid),playerid,playersconnected);
SendClientMessageToAll(COLOR_GREEN, string);
SendDeathMessage(INVALID_PLAYER_ID, playerid, 201);
return 1;
}
return 1;
}