SA-MP Forums Archive
[Ajuda] warning 209: function "cmd_deletacc" should return a value Pawn - 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] warning 209: function "cmd_deletacc" should return a value Pawn (/showthread.php?tid=593952)



warning 209: function "cmd_deletacc" should return a value Pawn - zPawnu - 11.11.2015

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;
    }
 } 



Re: warning 209: function "cmd_deletacc" should return a value Pawn - arakuta - 11.11.2015

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.


Re: warning 209: function "cmd_deletacc" should return a value Pawn - zPawnu - 11.11.2015

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


Re: warning 209: function "cmd_deletacc" should return a value Pawn - willttoonn - 11.11.2015

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; 
 }



Re: warning 209: function "cmd_deletacc" should return a value Pawn - zPawnu - 11.11.2015

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