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

Quote:
Originally Posted by ipsLuan
Посмотреть сообщение
Tente assim:
PHP код:
#include <a_samp>
#include <DOF2>
#include <sscanf>
#define function::%0(%1) forward %0(%1);public %0(%1)
function::save_player(playerid
{
    new
        
nome_player[MAX_PLAYER_NAME]
        
arquivo[34]
    ;
    
GetPlayerName(playeridnome_playersizeof(nome_player));
    
format(arquivosizeof(arquivo), "Admins/%s.ini"nome_player);
    if(!
DOF2_FileExists(arquivo)) 
        
DOF2_CreateFile(arquivo);
    if(
DOF2_FileExists(arquivo))
        
DOF2_SetInt(arquivo"Level"pAdmin[playerid][Level]); 
        
DOF2_SaveFile();
    return 
1;
}
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;
    
save_player(id); 
    return 
1

Up up
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: 2 Guest(s)