[Ajuda] Sistema de admin nгo salva
#7

Quote:
Originally Posted by ipsLuan
Посмотреть сообщение
Manda o cуdigo que faz o salvamento.
salva ao desconectar
PHP код:
public OnPlayerDisconnect(playerid)
{
    
// admin
    
new arquiva[34], playernome[MAX_PLAYER_NAME];
    
GetPlayerName(playeridplayernomesizeof(playernome));
    
format(arquivasizeof(arquiva), "Admins/%s.ini"playernome);
    if(
DOF2_FileExists(arquiva))
    {
        
DOF2_SetInt(arquiva"Level"pAdmin[playerid][Level]);
        
DOF2_SaveFile();
    }
    else
    {
        
DOF2_CreateFile(arquiva);
        
DOF2_SetInt(arquiva"Level"pAdmin[playerid][Level]);
        
DOF2_SaveFile();
    }
    
// admin
    
    
return 1;

dб o admin

PHP код:

CMD
:setadmin(playeridparams[])
{
    new 
idlevelstring[256], string2[256], ganhou[MAX_PLAYER_NAME], deu[MAX_PLAYER_NAME];
    if(!
IsPlayerAdmin(playerid)) return SendClientMessage(playerid0xAD0000AA"{00E5FF}Vocк nгo estб autorizado.");
    if(
sscanf(params"ud"idlevel)) return SendClientMessage(playerid0xAD0000AA"Use /daradmin [ID] [LEVEL]");
    if (
level || level 6) return SendClientMessage(playerid0xFF0000FF"Level invбlido. Use de 1 б 6 .");
    if(!
IsPlayerConnected(id)) return SendClientMessage(playerid0xAD0000AA"Este jogador nгo estб online.");
    
GetPlayerName(idganhousizeof(ganhou));
    
GetPlayerName(playeriddeusizeof(deu));
    
format(stringsizeof(string), "Vocк deu admin level %s para o %s"GetLevelAdmin(level), ganhou);
    
SendClientMessage(playerid0x00F6F6AAstring);
    
format(string2sizeof(string2), "O admin %s deu admin level %s para vocк."deu GetLevelAdmin(level));
    
SendClientMessage(idVERDEstring2);
    
pAdmin[id][Level] =  level;
    return 
1;

Reply


Messages In This Thread
Sistema de admin nгo salva - by DKDarkking - 08.08.2015, 12:23
Re: Sistema de admin nгo salva - by iTakelot - 08.08.2015, 12:27
Re: Sistema de admin nгo salva - by DKDarkking - 08.08.2015, 12:35
Re: Sistema de admin nгo salva - by iTakelot - 08.08.2015, 12:40
Re: Sistema de admin nгo salva - by DKDarkking - 08.08.2015, 13:06
Re: Sistema de admin nгo salva - by ipsLuan - 08.08.2015, 14:17
Re: Sistema de admin nгo salva - by DKDarkking - 08.08.2015, 14:26
Re: Sistema de admin nгo salva - by ipsLuan - 08.08.2015, 14:50
Re: Sistema de admin nгo salva - by DKDarkking - 08.08.2015, 15:10
Re: Sistema de admin nгo salva - by DKDarkking - 09.08.2015, 16:58

Forum Jump:


Users browsing this thread: 1 Guest(s)