20.07.2012, 16:51
Entгo, й como esta acima, quando eu dou admin a um Player ou a mim mesmo, todo outro player que loga loga como admin o.o .
Tinha parado com Samp a um tempo, agora estou estudando DOF2.
Comecei a olhar o sistema Funeral, e de la tirei minha base, sу que ocorre o Bug citado acima..
Salvamento:
Connect, Disconnect:
Entгo, й isso, Onde esta o erro? '-'
Tinha parado com Samp a um tempo, agora estou estudando DOF2.
Comecei a olhar o sistema Funeral, e de la tirei minha base, sу que ocorre o Bug citado acima..
pawn Код:
if(strcmp(cmd, "/daradmin", true) ==0 )
{
GetPlayerName(playerid, sendername, 256);
if (Info[playerid][DAdmin] >= 0) //Sу pra mim logar com player sem admin e me auto promover e.e
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, CINZA, "USE: /daradmin [ id ] [Level 0 б 4]");
return true;
}
new para1;
new level;
para1 = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
level = strval(tmp);
GetPlayerName(playerid, sendername, 256);
{
if(IsPlayerConnected(para1))
{
if(para1 != INVALID_PLAYER_ID)
{
GetPlayerName(para1, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
Info[para1][DAdmin] = level;
printf("%s Promoveu %s a Admin Level %d.", sendername, giveplayer, level);
format(string, sizeof(string), " Voce foi promovido para level %d de Admin - Por %s", level, sendername);
SendClientMessage(para1, AZUL, string);
format(string, sizeof(string), " Voce promoveu o(a) %s Para o level %d de Admin.", giveplayer,level);
SendClientMessage(playerid, AZUL, string);
format(string, sizeof(string), "%s Promoveu %s a Admin level %d ",sendername,giveplayer,level);
}
}
SendClientMessage(playerid, VERDE, "{FF0000}[BFG]{FFFFFF}: Voce nгo esta autorizado a usar este comando!");
}
}
return true;
}
pawn Код:
stock PlayerArchive(playerid)
{
new StringArquivo[128], NomeArquivo[24];
GetPlayerName(playerid, NomeArquivo, sizeof(NomeArquivo));
format(StringArquivo, sizeof(StringArquivo), ContasSalvas, NomeArquivo);
return StringArquivo;
}
stock CarregarDados(playerid)
{
Info[playerid][DAdmin] = DOF2_GetInt(PlayerArchive(playerid), "Administrador");
GivePlayerMoney(playerid, DOF2_GetInt(PlayerArchive(playerid), "Grana"));
Info[playerid][PlayerScore] = DOF2_GetInt(PlayerArchive(playerid), "Score");
Info[playerid][PlayerKills] = DOF2_GetInt(PlayerArchive(playerid), "Kills");
Info[playerid][PlayerDeaths] = DOF2_GetInt(PlayerArchive(playerid), "Morreu");
Info[playerid][PlayerVip] = DOF2_GetInt(PlayerArchive(playerid), "Vip");
Info[playerid][PlayerBanido] = DOF2_GetInt(PlayerArchive(playerid), "Banido");
}
stock SalvarDados(playerid)
{
DOF2_SetInt(PlayerArchive(playerid), "Grana", GetPlayerMoney(playerid));
DOF2_SetInt(PlayerArchive(playerid), "Administrador", Info[playerid][DAdmin]);
DOF2_SetInt(PlayerArchive(playerid), "Score", GetPlayerScore(playerid));
DOF2_SetInt(PlayerArchive(playerid), "Kills", Info[playerid][PlayerKills]);
DOF2_SetInt(PlayerArchive(playerid), "Morreu", Info[playerid][PlayerDeaths]);
DOF2_SetInt(PlayerArchive(playerid), "Vip", Info[playerid][PlayerVip]);
DOF2_SetInt(PlayerArchive(playerid), "Banido", Info[playerid][PlayerBanido]);
DOF2_SaveFile();
return 1;
}
pawn Код:
public OnPlayerConnect(playerid)
{
new i = 0;
TextDrawShowForPlayer(playerid, Baixo[i]);
GameTextForPlayer(playerid, "~r~Fuchter ~w~Games~r~4Fun",6000,6);
if(Info[playerid][PlayerBanido] == 1) return SendClientMessage(playerid, VERMELHO, "Banido do Servidor Temporariбmente, Bye!"), Kick(playerid);
if(DOF2_FileExists(PlayerArchive(playerid)))
{
ShowPlayerDialog(playerid, DLogar, DIALOG_STYLE_INPUT,"Logando no Servidor", "Bem Vindo Novamente\nLogue-se com Sua Senha do Registro","Logar","Cancelar");
}
else
{
ShowPlayerDialog(playerid, DRegistrar, DIALOG_STYLE_INPUT,"Registrando no Servidor", "Bem Vindo ao Servidor\nDigite sua Senha Abaixo Para Registrar-se","Registrar","Cancelar");
}
AddNitro[i][0] = 0;
GetPlayerName(playerid, NameDoug, sizeof(NameDoug));
format(SDoug, sizeof(SDoug), "[ID: %d] %s Entrou no Servidor!", playerid, NameDoug);
SendClientMessageToAll(AMARELO, SDoug);
return 1;
}
public OnPlayerDisconnect(playerid, reason) {
new i = 0;
TextDrawHideForPlayer(playerid, Baixo[i]);
DOF2_SetInt(PlayerArchive(playerid), "Administrador", Info[playerid][DAdmin]);
DOF2_SetInt(PlayerArchive(playerid), "Grana", GetPlayerMoney(playerid));
DOF2_SetInt(PlayerArchive(playerid), "Score", Info[playerid][PlayerScore]);
DOF2_SetInt(PlayerArchive(playerid), "Kills", Info[playerid][PlayerKills]);
DOF2_SetInt(PlayerArchive(playerid), "Deaths", Info[playerid][PlayerDeaths]);
DOF2_SetInt(PlayerArchive(playerid), "Vip", Info[playerid][PlayerVip]);
DOF2_SaveFile();
GetPlayerName(playerid, NameDoug, sizeof(NameDoug));
format(SDoug, sizeof(SDoug), "[ID: %d] %s Saiu do Servidor!", playerid, NameDoug);
SendClientMessageToAll(AMARELO, SDoug);
AddNitro[i][0] = 0;
return 1;
}