SA-MP Forums Archive
[Ajuda] Problemas com DOF2_SetInt e DOF2_GetString - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] Problemas com DOF2_SetInt e DOF2_GetString (/showthread.php?tid=652392)



Problemas com DOF2_SetInt e DOF2_GetString - k2bi - 09.04.2018

Bom estou com duvida em fazer o seguinte, pegar a string "cargo" que vai estar armazenando certa quantia que o player escolher e colocar na DOF2_SetInt ex: DOF2_SetInt(file, "AdminC", PlayerAdmin [playerid] [pNivel] = cargo(no caso esse cargo sera o numero setado pelo admin)
Quote:

if(IsPlayerConnected(playerid)){
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xFF0000AA, "Vocк nгo pode acessar esse comando");
else
if(IsPlayerAdmin(playerid)){
new id, uname[MAX_PLAYER_NAME], cargo[128], string[128], pname[MAX_PLAYER_NAME], string2[128];
if(sscanf(params, "us[128]", id, cargo)) return SendClientMessage (playerid, 0x00FF00AA, "Comando: /Setplayeradmin [ID] [CARGO]");
if(!IsPlayerConnected(id)) return SendClientMessage (playerid, 0xFF0000AA, "ID nгo conectado");
GetPlayerName(id, uname, sizeof(uname));
GetPlayerName(playerid, pname, sizeof(pname));
format(file, sizeof(file), Admin, uname);

new str2[128],
hour,
minute,
second;
gettime(hour,minute,second);
format(str2, sizeof(str2), "%d:%d:%d", hour, minute, second);
DOF2_CreateFile(file);
DOF2_SetString(file, "Cargo Staff", cargo);
DOF2_SetString(file, "Promovido Por", pname);
DOF2_SetString(file, "Hora", str2);




Re: Problemas com DOF2_SetInt e DOF2_GetString - XandyMello - 10.04.2018

PHP Code:
CMD:daradmin(playeridparams[])
{
    if(!
IsPlayerAdmin(playerid))
        return 
SendClientMessage(playerid0xFF0000AA"Vocк nгo pode acessar esse comando");

    new
        
id,
        
cargo
    
;
    if(
sscanf(params"ud"idcargo))
        return 
SendClientMessage (playerid0x00FF00AA"Comando: /Setplayeradmin [ID] [CARGO(Nъmero)]");

    if(!
IsPlayerConnected(id))
        return 
SendClientMessage (playerid0xFF0000AA"ID nгo conectado");

    
PlayerAdmin[ID][pNivel] = cargo;
    
    new 
file[64];
    
GetPlayerName(idNamesizeof(Name));
    
format(filesizeof(file), Admin/*Caminho*/uname);

    new
        
str2[20],
        
hour,
        
minute,
        
second
    
;
    
gettime(hour,minute,second);
    
format(str2sizeof(str2), "%d:%d:%d"hourminutesecond);
    if(!
DOF2_FileExists(file)) { DOF2_CreateFile(file); }
    
DOF2_SetInt(file"Cargo Staff"PlayerAdmin[ID][pNivel]);
    
GetPlayerName(playeridNamesizeof(Name));
    
DOF2_SetString(file"Promovido Por"Name);
    
DOF2_SetString(file"Hora"str2);
    return 
true;