[Ajuda] warning 209: function "cmd_deletacc" should return a value Pawn
#1

poderiam me ajudar com esse codigo que eu fiz ?


C:\Users\Jefferson\Desktop\www adm dayz\supremo.pwn(13 : warning 209: function "cmd_deletacc" should return a value
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Warning.


PHP Code:

CMD
:deletacc(playerid,params[])
{
         if(
pSuper[playerid][Supremo] >= 1)
    {
        new 
file2[155], aname[MAX_PLAYER_NAME], string[125];
         
GetPlayerName(playeridanamesizeof(aname));
        
format(file2sizeof(file2), "Contas/%s.ini"aname);
        if (
DOF2_FileExists(file2)) {
        
DOF2_RemoveFile(file2);
        
format(stringsizeof(string), " | INFO |  Vocк deletou a conta %s.");
        
SendClientMessage(playerid, -1string);
        
format(stringsizeof(string), " | INFO-SERVER | O Administrador %s deletou a conta: %s"aname);
        
SendClientMessageToAll(-1string);
    }
        else {
        
SendClientMessage(playerid, -1" | ERRO | Este usuario nгo existe!");
    }
        return 
1;
    }
 } 
Reply
#2

Vocк sempre deve retornar algum valor em comandos via ZCMD para serem utilizados pelas callbacks de uso de comandos (nгo me recordo o nome agora).

Vocк sу estб retornando algum valor se o jogador for supremo.
Reply
#3

Quote:
Originally Posted by arakuta
View Post
Vocк sempre deve retornar algum valor em comandos via ZCMD para serem utilizados pelas callbacks de uso de comandos (nгo me recordo o nome agora).

Vocк sу estб retornando algum valor se o jogador for supremo.
eu removi a if do supremo pra testar e deu no mesmo
Reply
#4

Aquele return ali, nгo vai servir de nada se nгo tem nada embaixo do cуdigo que vocк deseja privar caso ele nгo tenha aquele IF.

Entгo usa assim:

Code:
CMD:deletacc(playerid,params[]) 
{ 
	if(pSuper[playerid][Supremo] >= 1) 
    { 
        new file2[155], aname[MAX_PLAYER_NAME], string[125]; 
        GetPlayerName(playerid, aname, sizeof(aname)); 
        format(file2, sizeof(file2), "Contas/%s.ini", aname); 

        if (DOF2_FileExists(file2)) 
		{ 
			DOF2_RemoveFile(file2); 
			format(string, sizeof(string), " | INFO |  Vocк deletou a conta %s."); 
			SendClientMessage(playerid, -1, string); 
			format(string, sizeof(string), " | INFO-SERVER | O Administrador %s deletou a conta: %s", aname); 
			SendClientMessageToAll(-1, string); 
		}	 
        else 
		{ 
			SendClientMessage(playerid, -1, " | ERRO | Este usuario nгo existe!"); 
		} 
    } 
	return 1; 
 }
Reply
#5

Quote:
Originally Posted by willttoonn
View Post
Aquele return ali, nгo vai servir de nada se nгo tem nada embaixo do cуdigo que vocк deseja privar caso ele nгo tenha aquele IF.

Entгo usa assim:

Code:
CMD:deletacc(playerid,params[]) 
{ 
	if(pSuper[playerid][Supremo] >= 1) 
    { 
        new file2[155], aname[MAX_PLAYER_NAME], string[125]; 
        GetPlayerName(playerid, aname, sizeof(aname)); 
        format(file2, sizeof(file2), "Contas/%s.ini", aname); 

        if (DOF2_FileExists(file2)) 
		{ 
			DOF2_RemoveFile(file2); 
			format(string, sizeof(string), " | INFO |  Vocк deletou a conta %s."); 
			SendClientMessage(playerid, -1, string); 
			format(string, sizeof(string), " | INFO-SERVER | O Administrador %s deletou a conta: %s", aname); 
			SendClientMessageToAll(-1, string); 
		}	 
        else 
		{ 
			SendClientMessage(playerid, -1, " | ERRO | Este usuario nгo existe!"); 
		} 
    } 
	return 1; 
 }
aehh funfo mt obrigado
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)