[Ajuda]Quando dou estrela pro id 5 vai pro 0
#1

Galera й assim quando dou /procurar 5 5 envez de dar 5 estrelas pro id 5 dar 5 estrelas pro id 0 '-' como faзo agora ? ajudem porfavor

PHP код:
        if(strcmp(cmd"/procurar"true) == || strcmp(cmd"/wanted"true) == 0)
        {
                
GetPlayerName(playeridsendernamesizeof(sendername));
            
PlayerInfo[playerid][pBOPE] = dini_Int(udb_encode(sendername), "levelbope");
                new 
wlevelleveladd[256];
                
tmp strtok(cmdtextidx);
                
leveladd strtok(cmdtextidx);
                if(!
strlen(tmp))
                {
                        
SendClientMessage(playeridCOLOR_GREEN"Uso correto: /wanted(level) [id do player] [level (0-6)]");
                }
                
giveplayerid strval(tmp);
                if(!
strlen(tmp))
  {
                        
SendClientMessage(playeridCOLOR_GREEN"Uso correto: /wanted(level) [id do palyer] [level (0-6)]");
                }
                
wlevel strval(tmp);
                
GetPlayerName(giveplayeridgiveplayersizeof(giveplayer));
                if(
logged[playerid] == 1)
                {
                    if(
PlayerInfo[playerid][pBOPE] >= || PlayerInfo[playerid][pGOE] >= || PlayerInfo[playerid][pPM] >= || PlayerInfo[playerid][pEXC] >= 1)
                    {
                        if(
IsPlayerConnected(giveplayerid))
                        {
                            if(
wlevel >=|| wlevel  <=6)
                                        {
                                                
SendClientMessage(playeridCOLOR_GREEN"Wanted level syntax: 0 - 6");
                                        }
                                        
format(stringsizeof(string), "* ADMIN:: Vocк mudou o level de procurado de %s(%i) para %d."giveplayergiveplayeridwlevel);
                                        
SendClientMessage(playeridCOLOR_ADMstring);
                                        
format(tmpsizeof(tmp), "* ADMIN: %s(%i) mudou seu level de procurado para %d."sendernameplayeridwlevel);
                                        
SendClientMessage(giveplayeridCOLOR_ADMstring);
                                        
SetPlayerWantedLevel(giveplayeridwlevel);
                                }
                                else
                                {
                                    
format(stringsizeof(string), "%d nгo й um player ativo!"giveplayerid);
                                        
SendClientMessage(playeridCOLOR_CYANstring);
                                }
                        }
                        else
                        {
                                
SendClientMessage(playeridCOLOR_CYAN"Vocк nгo tem permissгo para usar este comando!");
                        }
                }
                else
                {
                    
SendClientMessage(playeridCOLOR_CYAN"Vocк tem que estar logado para usar este comando!");
                }
                return 
1;
        } 
Aguardando Resposta...
Reply
#2

Deve resolver o seu problema:
Код:
if( strcmp( cmd ,  "/procurar" ,  true ) == 0 || strcmp( cmd ,  "/wanted" ,  true ) == 0 ) 
{ 
	new 
	    wlevel;
	
	GetPlayerName( playerid ,  sendername ,  sizeof( sendername ) ); 
	PlayerInfo[playerid][pBOPE] = dini_Int( udb_encode( sendername ), "levelbope" ); 
	
	if( !strlen( tmp ) ) return SendClientMessage( playerid ,  COLOR_GREEN ,  "Uso correto: /wanted( level ) [id do player] [level ( 0-6 )]" ); 
	giveplayerid = strval( tmp ); 
	
	tmp = strtok( cmdtext ,  idx ); 
	if( !strlen( tmp ) ) return SendClientMessage( playerid ,  COLOR_GREEN ,  "Uso correto: /wanted( level ) [id do palyer] [level (0-6)]" ); 
	wlevel = strval( tmp ); 
	
	GetPlayerName( giveplayerid , giveplayer , sizeof( giveplayer ) ); 
	if( logged[playerid] == 1 ) 
	{ 
		if( PlayerInfo[playerid][pBOPE] >= 1 || PlayerInfo[playerid][pGOE] >= 1 || PlayerInfo[playerid][pPM] >= 1 || PlayerInfo[playerid][pEXC] >= 1 ) 
		{ 
			if( IsPlayerConnected( giveplayerid ) ) 
			{ 
				if(wlevel > 6) 
				return SendClientMessage( playerid ,  COLOR_GREEN ,  "Wanted level syntax: 0 - 6" ); 
				
				format( string ,  sizeof( string ) ,  "* ADMIN:: Vocк mudou o level de procurado de %s( %i ) para %d." ,  giveplayer ,  giveplayerid ,  wlevel ); 
				SendClientMessage( playerid ,  COLOR_ADM ,  string ); 
				format( tmp ,  sizeof( tmp ) ,  "* ADMIN: %s( %i ) mudou seu level de procurado para %d." ,  sendername ,  playerid ,  wlevel ); 
				SendClientMessage( giveplayerid ,  COLOR_ADM ,  string ); 
				return SetPlayerWantedLevel( giveplayerid ,  wlevel ); 

			} 
			else return format( string ,  sizeof( string ) ,  "%d nгo й um player ativo!" ,  giveplayerid ) , SendClientMessage( playerid ,  COLOR_CYAN ,  string ); 
		} 
		else return SendClientMessage( playerid ,  COLOR_CYAN ,  "Vocк nгo tem permissгo para usar este comando!" ); 
	}
	else return SendClientMessage( playerid ,  COLOR_CYAN ,  "Vocк tem que estar logado para usar este comando!" ); 
}
e:
Quote:
Originally Posted by [FeK]DraKiNs
Посмотреть сообщение
Usas um sistema de comandos (ycmd,fcmd,zcmd,kcmd,dcmd).
Aprendam isto,й mais fбcil.
Reply
#3

Quote:
Originally Posted by LuxurioN™
Посмотреть сообщение
Deve resolver o seu problema:
Код:
if( strcmp( cmd ,  "/procurar" ,  true ) == 0 || strcmp( cmd ,  "/wanted" ,  true ) == 0 ) 
{ 
	new 
	    wlevel;
	
	GetPlayerName( playerid ,  sendername ,  sizeof( sendername ) ); 
	PlayerInfo[playerid][pBOPE] = dini_Int( udb_encode( sendername ), "levelbope" ); 
	
	if( !strlen( tmp ) ) return SendClientMessage( playerid ,  COLOR_GREEN ,  "Uso correto: /wanted( level ) [id do player] [level ( 0-6 )]" ); 
	giveplayerid = strval( tmp ); 
	
	tmp = strtok( cmdtext ,  idx ); 
	if( !strlen( tmp ) ) return SendClientMessage( playerid ,  COLOR_GREEN ,  "Uso correto: /wanted( level ) [id do palyer] [level (0-6)]" ); 
	wlevel = strval( tmp ); 
	
	GetPlayerName( giveplayerid , giveplayer , sizeof( giveplayer ) ); 
	if( logged[playerid] == 1 ) 
	{ 
		if( PlayerInfo[playerid][pBOPE] >= 1 || PlayerInfo[playerid][pGOE] >= 1 || PlayerInfo[playerid][pPM] >= 1 || PlayerInfo[playerid][pEXC] >= 1 ) 
		{ 
			if( IsPlayerConnected( giveplayerid ) ) 
			{ 
				if(wlevel > 6) 
				return SendClientMessage( playerid ,  COLOR_GREEN ,  "Wanted level syntax: 0 - 6" ); 
				
				format( string ,  sizeof( string ) ,  "* ADMIN:: Vocк mudou o level de procurado de %s( %i ) para %d." ,  giveplayer ,  giveplayerid ,  wlevel ); 
				SendClientMessage( playerid ,  COLOR_ADM ,  string ); 
				format( tmp ,  sizeof( tmp ) ,  "* ADMIN: %s( %i ) mudou seu level de procurado para %d." ,  sendername ,  playerid ,  wlevel ); 
				SendClientMessage( giveplayerid ,  COLOR_ADM ,  string ); 
				return SetPlayerWantedLevel( giveplayerid ,  wlevel ); 

			} 
			else return format( string ,  sizeof( string ) ,  "%d nгo й um player ativo!" ,  giveplayerid ) , SendClientMessage( playerid ,  COLOR_CYAN ,  string ); 
		} 
		else return SendClientMessage( playerid ,  COLOR_CYAN ,  "Vocк nгo tem permissгo para usar este comando!" ); 
	}
	else return SendClientMessage( playerid ,  COLOR_CYAN ,  "Vocк tem que estar logado para usar este comando!" ); 
}
e:
mano botei o codigo mais nem quer funcionar aparece isso dentro do jogo quando boto o comando "Uso correto: /wanted( level ) [id do palyer] [level (0-6)]"
Reply
#4

Quote:
Originally Posted by Nake01
Посмотреть сообщение
mano botei o codigo mais nem quer funcionar aparece isso dentro do jogo quando boto o comando "Uso correto: /wanted( level ) [id do palyer] [level (0-6)]"
Apenas coloque:
Код:
tmp = strtok( cmdtext ,  idx );
logo em cima do primeiro "if( !strlen( tmp ) )".
Assim:
Код:
if( strcmp( cmd ,  "/procurar" ,  true ) == 0 || strcmp( cmd ,  "/wanted" ,  true ) == 0 ) 
{ 
	new 
	    wlevel;
	
	GetPlayerName( playerid ,  sendername ,  sizeof( sendername ) ); 
	PlayerInfo[playerid][pBOPE] = dini_Int( udb_encode( sendername ), "levelbope" ); 
	
	tmp = strtok( cmdtext ,  idx ); 
	if( !strlen( tmp ) ) return SendClientMessage( playerid ,  COLOR_GREEN ,  "Uso correto: /wanted( level ) [id do player] [level ( 0-6 )]" ); 
	giveplayerid = strval( tmp ); 
	
	tmp = strtok( cmdtext ,  idx ); 
	if( !strlen( tmp ) ) return SendClientMessage( playerid ,  COLOR_GREEN ,  "Uso correto: /wanted( level ) [id do palyer] [level (0-6)]" ); 
	wlevel = strval( tmp ); 
	
	GetPlayerName( giveplayerid , giveplayer , sizeof( giveplayer ) ); 
	if( logged[playerid] == 1 ) 
	{ 
		if( PlayerInfo[playerid][pBOPE] >= 1 || PlayerInfo[playerid][pGOE] >= 1 || PlayerInfo[playerid][pPM] >= 1 || PlayerInfo[playerid][pEXC] >= 1 ) 
		{ 
			if( IsPlayerConnected( giveplayerid ) ) 
			{ 
				if(wlevel > 6) 
				return SendClientMessage( playerid ,  COLOR_GREEN ,  "Wanted level syntax: 0 - 6" ); 
				
				format( string ,  sizeof( string ) ,  "* ADMIN:: Vocк mudou o level de procurado de %s( %i ) para %d." ,  giveplayer ,  giveplayerid ,  wlevel ); 
				SendClientMessage( playerid ,  COLOR_ADM ,  string ); 
				format( tmp ,  sizeof( tmp ) ,  "* ADMIN: %s( %i ) mudou seu level de procurado para %d." ,  sendername ,  playerid ,  wlevel ); 
				SendClientMessage( giveplayerid ,  COLOR_ADM ,  string ); 
				return SetPlayerWantedLevel( giveplayerid ,  wlevel ); 

			} 
			else return format( string ,  sizeof( string ) ,  "%d nгo й um player ativo!" ,  giveplayerid ) , SendClientMessage( playerid ,  COLOR_CYAN ,  string ); 
		} 
		else return SendClientMessage( playerid ,  COLOR_CYAN ,  "Vocк nгo tem permissгo para usar este comando!" ); 
	}
	else return SendClientMessage( playerid ,  COLOR_CYAN ,  "Vocк tem que estar logado para usar este comando!" ); 
}
Resolverб seu problema.
Reply
#5

Obrigado LuxurioN™ Resolveu sim, mano tu й 10 !
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)