[Pedido] Ajuda num comando aqui
#1

Alguem manda esse comando pra sу usa quando tiver logado na rcon pfv?

Код:
	if(strcmp(cmd, "/criaradmin", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
     {
	    	if(PlayerInfo[playerid][pAdmin] < 1337)
	    	{
				SendClientMessage(playerid, COLOR_GRAD1, "Vocк nгo pode usar este comando!");
				return 1;
	    	}
	        AdmsVaga();
	    	if(VagaSobrando == 0)
	    	{
				//SendClientMessage(playerid, COLOR_GRAD1, "Nгo hб mais vagas na lista use /limparadm primeiro.");
				//return 1;
	    	}
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "USE: /criaradmin [id] [Nivel(de 1 a 3)]");
				return 1;
			}
			new para1;
			new level;
			para1 = ReturnUser(tmp);
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "USE: /criaradmin [id] [Nivel(de 1 a 3)]");
				return 1;
			}
			level = strval(tmp);
			if(level > 3001)
			{
			    SendClientMessage(playerid, COLOR_GRAD1, "	Nгo se pode criar um admin com nivel maior que 3001");
			    return true;
			}
			if(level == 0)
			{

			}
			GetPlayerName(para1, giveplayer, sizeof(giveplayer));
			GetPlayerName(playerid, sendername, sizeof(sendername));
		    if(IsPlayerConnected(para1))
		    {
		        if(para1 != INVALID_PLAYER_ID)
		        {

					format(string, sizeof(string), "   Vocк foi promovido a nivel %d de admin, pelo admin %s", level, sendername);
					SendClientMessage(para1, COLOR_LIGHTBLUE, string);
					format(string, sizeof(string), "   Vocк promoveu %s Para admin Nivel %d", giveplayer,level);
					SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
					getdate(year, month, day);
					gettime(hour,minute,second);
					format(string, sizeof(string), "%s deu admin nivel %d para %s [%d/%d/%d] бs [%d:%d:%d].", sendername, level, giveplayer, day,
					month, year, hour, minute, second);
					PAdminsLog(string);
					for(new i = 0; i < sizeof(AdmInfo); i++)
    				{
						if(PlayerInfo[para1][pAdmin] > 0)
						{
						    PlayerInfo[para1][pAdmin] = level;
						    break;
						}
   						else if(AdmInfo[i][AdminVaga] == 0)
						{
							PlayerInfo[para1][pAdmin] = level;
							AdmInfo[i][gMembro] = giveplayer;
							AdmInfo[i][AdminVaga] = 1;
							//SaveAdm();
							break;
						}
					}
				}
			}
		}
		return 1;
	}
Reply
#2

PHP код:
if(strcmp(cmd"/criaradmin"true) == 0)
    {
        if(
IsPlayerConnected(playerid)) return SendClientMessage(playerid0xFF55FF"Erro id nгo conectado");
        if(!
IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1"Vocк nгo estб logado na RCON!");
            
AdmsVaga();
            if(
VagaSobrando == 0)
            {
                
//SendClientMessage(playerid, COLOR_GRAD1, "Nгo hб mais vagas na lista use /limparadm primeiro.");
                //return 1;
            
}
            
tmp strtok(cmdtextidx);
            if(!
strlen(tmp))
            {
                
SendClientMessage(playeridCOLOR_GRAD2"USE: /criaradmin [id] [Nivel(de 1 a 3)]");
                return 
1;
            }
            new 
para1;
            new 
level;
            
para1 ReturnUser(tmp);
            
tmp strtok(cmdtextidx);
            if(!
strlen(tmp))
            {
                
SendClientMessage(playeridCOLOR_GRAD2"USE: /criaradmin [id] [Nivel(de 1 a 3)]");
                return 
1;
            }
            
level strval(tmp);
            if(
level 3001)
            {
                
SendClientMessage(playeridCOLOR_GRAD1"    Nгo se pode criar um admin com nivel maior que 3001");
                return 
true;
            }
            if(
level == 0)
            {
            }
            
GetPlayerName(para1giveplayersizeof(giveplayer));
            
GetPlayerName(playeridsendernamesizeof(sendername));
            if(
IsPlayerConnected(para1))
            {
                if(
para1 != INVALID_PLAYER_ID)
                {
                    
format(stringsizeof(string), "   Vocк foi promovido a nivel %d de admin, pelo admin %s"levelsendername);
                    
SendClientMessage(para1COLOR_LIGHTBLUEstring);
                    
format(stringsizeof(string), "   Vocк promoveu %s Para admin Nivel %d"giveplayer,level);
                    
SendClientMessage(playeridCOLOR_LIGHTBLUEstring);
                    
getdate(yearmonthday);
                    
gettime(hour,minute,second);
                    
format(stringsizeof(string), "%s deu admin nivel %d para %s [%d/%d/%d] бs [%d:%d:%d]."sendernamelevelgiveplayerday,
                    
monthyearhourminutesecond);
                    
PAdminsLog(string);
                    for(new 
0sizeof(AdmInfo); i++)
                    {
                        if(
PlayerInfo[para1][pAdmin] > 0)
                        {
                            
PlayerInfo[para1][pAdmin] = level;
                            break;
                        }
                           else if(
AdmInfo[i][AdminVaga] == 0)
                        {
                            
PlayerInfo[para1][pAdmin] = level;
                            
AdmInfo[i][gMembro] = giveplayer;
                            
AdmInfo[i][AdminVaga] = 1;
                            
//SaveAdm();
                            
break;
                        }
                    }
                }
            }
        }
        return 
1;
    } 
ae fisso por aki mesmo se estive dando erros poste aki n mexi ne nada so colokei pra rcon
Reply
#3

Й sу criar uma if(IsPlayerAdmin). Й a funзгo que detecta se o player estб logado na RCON.
Reply
#4

Quote:
Originally Posted by R3S1D3NT1
Посмотреть сообщение
PHP код:
if(strcmp(cmd"/criaradmin"true) == 0)
    {
        if(
IsPlayerConnected(playerid)) return SendClientMessage(playerid0xFF55FF"Erro id nгo conectado");
        if(!
IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1"Vocк nгo estб logado na RCON!");
            
AdmsVaga();
            if(
VagaSobrando == 0)
            {
                
//SendClientMessage(playerid, COLOR_GRAD1, "Nгo hб mais vagas na lista use /limparadm primeiro.");
                //return 1;
            
}
            
tmp strtok(cmdtextidx);
            if(!
strlen(tmp))
            {
                
SendClientMessage(playeridCOLOR_GRAD2"USE: /criaradmin [id] [Nivel(de 1 a 3)]");
                return 
1;
            }
            new 
para1;
            new 
level;
            
para1 ReturnUser(tmp);
            
tmp strtok(cmdtextidx);
            if(!
strlen(tmp))
            {
                
SendClientMessage(playeridCOLOR_GRAD2"USE: /criaradmin [id] [Nivel(de 1 a 3)]");
                return 
1;
            }
            
level strval(tmp);
            if(
level 3001)
            {
                
SendClientMessage(playeridCOLOR_GRAD1"    Nгo se pode criar um admin com nivel maior que 3001");
                return 
true;
            }
            if(
level == 0)
            {
            }
            
GetPlayerName(para1giveplayersizeof(giveplayer));
            
GetPlayerName(playeridsendernamesizeof(sendername));
            if(
IsPlayerConnected(para1))
            {
                if(
para1 != INVALID_PLAYER_ID)
                {
                    
format(stringsizeof(string), "   Vocк foi promovido a nivel %d de admin, pelo admin %s"levelsendername);
                    
SendClientMessage(para1COLOR_LIGHTBLUEstring);
                    
format(stringsizeof(string), "   Vocк promoveu %s Para admin Nivel %d"giveplayer,level);
                    
SendClientMessage(playeridCOLOR_LIGHTBLUEstring);
                    
getdate(yearmonthday);
                    
gettime(hour,minute,second);
                    
format(stringsizeof(string), "%s deu admin nivel %d para %s [%d/%d/%d] бs [%d:%d:%d]."sendernamelevelgiveplayerday,
                    
monthyearhourminutesecond);
                    
PAdminsLog(string);
                    for(new 
0sizeof(AdmInfo); i++)
                    {
                        if(
PlayerInfo[para1][pAdmin] > 0)
                        {
                            
PlayerInfo[para1][pAdmin] = level;
                            break;
                        }
                           else if(
AdmInfo[i][AdminVaga] == 0)
                        {
                            
PlayerInfo[para1][pAdmin] = level;
                            
AdmInfo[i][gMembro] = giveplayer;
                            
AdmInfo[i][AdminVaga] = 1;
                            
//SaveAdm();
                            
break;
                        }
                    }
                }
            }
        }
        return 
1;
    } 
ae fisso por aki mesmo se estive dando erros poste aki n mexi ne nada so colokei pra rcon
O pawno para de responder qd vai compila
Reply
#5

eu acho que falta um {

if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "Vocк nгo estб logado na RCON!");

nao tenho certeza
Reply
#6

tente assim:
Код:
	if(strcmp(cmd, "/criaradmin", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
     {
    		if(!IsPlayerAdmin(playerid))
			return;
	    	{
				SendClientMessage(playerid, COLOR_GRAD1, "[x] Apenas Adm Rcon pode usar esse CMD!");
	    	}
	        AdmsVaga();
	    	if(VagaSobrando == 0)
	    	{
				//SendClientMessage(playerid, COLOR_GRAD1, "Nгo hб mais vagas na lista use /limparadm primeiro.");
				//return 1;
	    	}
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "USE: /criaradmin [id] [Nivel(de 1 a 3)]");
				return 1;
			}
			new para1;
			new level;
			para1 = ReturnUser(tmp);
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "USE: /criaradmin [id] [Nivel(de 1 a 3)]");
				return 1;
			}
			level = strval(tmp);
			if(level > 3001)
			{
			    SendClientMessage(playerid, COLOR_GRAD1, "	Nгo se pode criar um admin com nivel maior que 3001");
			    return true;
			}
			if(level == 0)
			{

			}
			GetPlayerName(para1, giveplayer, sizeof(giveplayer));
			GetPlayerName(playerid, sendername, sizeof(sendername));
		    if(IsPlayerConnected(para1))
		    {
		        if(para1 != INVALID_PLAYER_ID)
		        {

					format(string, sizeof(string), "   Vocк foi promovido a nivel %d de admin, pelo admin %s", level, sendername);
					SendClientMessage(para1, COLOR_LIGHTBLUE, string);
					format(string, sizeof(string), "   Vocк promoveu %s Para admin Nivel %d", giveplayer,level);
					SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
					getdate(year, month, day);
					gettime(hour,minute,second);
					format(string, sizeof(string), "%s deu admin nivel %d para %s [%d/%d/%d] бs [%d:%d:%d].", sendername, level, giveplayer, day,
					month, year, hour, minute, second);
					PAdminsLog(string);
					for(new i = 0; i < sizeof(AdmInfo); i++)
    				{
						if(PlayerInfo[para1][pAdmin] > 0)
						{
						    PlayerInfo[para1][pAdmin] = level;
						    break;
						}
   						else if(AdmInfo[i][AdminVaga] == 0)
						{
							PlayerInfo[para1][pAdmin] = level;
							AdmInfo[i][gMembro] = giveplayer;
							AdmInfo[i][AdminVaga] = 1;
							//SaveAdm();
							break;
						}
					}
				}
			}
		}
		return 1;
	}
Reply
#7

Quote:
Originally Posted by billy the kid
Посмотреть сообщение
eu acho que falta um {

if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "Vocк nгo estб logado na RCON!");

nao tenho certeza
Continua dando Erro Mano,ele trava o pawno e tem q clica em "Nгo Enviar Agora"
Reply
#8

Quote:
Originally Posted by [BCV]Dr.House_.
Посмотреть сообщение
tente assim:
Код:
	if(strcmp(cmd, "/criaradmin", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
     {
    		if(!IsPlayerAdmin(playerid))
			return;
	    	{
				SendClientMessage(playerid, COLOR_GRAD1, "[x] Apenas Adm Rcon pode usar esse CMD!");
	    	}
	        AdmsVaga();
	    	if(VagaSobrando == 0)
	    	{
				//SendClientMessage(playerid, COLOR_GRAD1, "Nгo hб mais vagas na lista use /limparadm primeiro.");
				//return 1;
	    	}
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "USE: /criaradmin [id] [Nivel(de 1 a 3)]");
				return 1;
			}
			new para1;
			new level;
			para1 = ReturnUser(tmp);
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "USE: /criaradmin [id] [Nivel(de 1 a 3)]");
				return 1;
			}
			level = strval(tmp);
			if(level > 3001)
			{
			    SendClientMessage(playerid, COLOR_GRAD1, "	Nгo se pode criar um admin com nivel maior que 3001");
			    return true;
			}
			if(level == 0)
			{

			}
			GetPlayerName(para1, giveplayer, sizeof(giveplayer));
			GetPlayerName(playerid, sendername, sizeof(sendername));
		    if(IsPlayerConnected(para1))
		    {
		        if(para1 != INVALID_PLAYER_ID)
		        {

					format(string, sizeof(string), "   Vocк foi promovido a nivel %d de admin, pelo admin %s", level, sendername);
					SendClientMessage(para1, COLOR_LIGHTBLUE, string);
					format(string, sizeof(string), "   Vocк promoveu %s Para admin Nivel %d", giveplayer,level);
					SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
					getdate(year, month, day);
					gettime(hour,minute,second);
					format(string, sizeof(string), "%s deu admin nivel %d para %s [%d/%d/%d] бs [%d:%d:%d].", sendername, level, giveplayer, day,
					month, year, hour, minute, second);
					PAdminsLog(string);
					for(new i = 0; i < sizeof(AdmInfo); i++)
    				{
						if(PlayerInfo[para1][pAdmin] > 0)
						{
						    PlayerInfo[para1][pAdmin] = level;
						    break;
						}
   						else if(AdmInfo[i][AdminVaga] == 0)
						{
							PlayerInfo[para1][pAdmin] = level;
							AdmInfo[i][gMembro] = giveplayer;
							AdmInfo[i][AdminVaga] = 1;
							//SaveAdm();
							break;
						}
					}
				}
			}
		}
		return 1;
	}
pawn Код:
C:\DOCUME~1\Rodrigo\CONFIG~1\Temp\Rar$DI89.808\GameAnarchy.pwn(4565) : warning 202: number of arguments does not match definition
C:\DOCUME~1\Rodrigo\CONFIG~1\Temp\Rar$DI89.808\GameAnarchy.pwn(4589) : warning 202: number of arguments does not match definition
C:\DOCUME~1\Rodrigo\CONFIG~1\Temp\Rar$DI89.808\GameAnarchy.pwn(22226) : warning 209: function "OnPlayerCommandText" should return a value
C:\DOCUME~1\Rodrigo\CONFIG~1\Temp\Rar$DI89.808\GameAnarchy.pwn(22240) : error 078: function uses both "return" and "return <value>"
C:\DOCUME~1\Rodrigo\CONFIG~1\Temp\Rar$DI89.808\GameAnarchy.pwn(22249) : error 078: function uses both "return" and "return <value>"
C:\DOCUME~1\Rodrigo\CONFIG~1\Temp\Rar$DI89.808\GameAnarchy.pwn(22255) : error 078: function uses both "return" and "return <value>"
C:\DOCUME~1\Rodrigo\CONFIG~1\Temp\Rar$DI89.808\GameAnarchy.pwn(22296) : error 078: function uses both "return" and "return <value>"
C:\DOCUME~1\Rodrigo\CONFIG~1\Temp\Rar$DI89.808\GameAnarchy.pwn(22326) : error 078: function uses both "return" and "return <value>"
C:\DOCUME~1\Rodrigo\CONFIG~1\Temp\Rar$DI89.808\GameAnarchy.pwn(22337) : error 078: function uses both "return" and "return <value>"
C:\DOCUME~1\Rodrigo\CONFIG~1\Temp\Rar$DI89.808\GameAnarchy.pwn(22364) : error 078: function uses both "return" and "return <value>"
C:\DOCUME~1\Rodrigo\CONFIG~1\Temp\Rar$DI89.808\GameAnarchy.pwn(22378) : error 078: function uses both "return" and "return <value>"
C:\DOCUME~1\Rodrigo\CONFIG~1\Temp\Rar$DI89.808\GameAnarchy.pwn(22388) : error 078: function uses both "return" and "return <value>"
C:\DOCUME~1\Rodrigo\CONFIG~1\Temp\Rar$DI89.808\GameAnarchy.pwn(22394) : error 078: function uses both "return" and "return <value>"
C:\DOCUME~1\Rodrigo\CONFIG~1\Temp\Rar$DI89.808\GameAnarchy.pwn(22399) : error 078: function uses both "return" and "return <value>"
C:\DOCUME~1\Rodrigo\CONFIG~1\Temp\Rar$DI89.808\GameAnarchy.pwn(22410) : error 078: function uses both "return" and "return <value>"
C:\DOCUME~1\Rodrigo\CONFIG~1\Temp\Rar$DI89.808\GameAnarchy.pwn(22419) : error 078: function uses both "return" and "return <value>"
C:\DOCUME~1\Rodrigo\CONFIG~1\Temp\Rar$DI89.808\GameAnarchy.pwn(22428) : error 078: function uses both "return" and "return <value>"
C:\DOCUME~1\Rodrigo\CONFIG~1\Temp\Rar$DI89.808\GameAnarchy.pwn(22437) : error 078: function uses both "return" and "return <value>"
C:\DOCUME~1\Rodrigo\CONFIG~1\Temp\Rar$DI89.808\GameAnarchy.pwn(22446) : error 078: function uses both "return" and "return <value>"
C:\DOCUME~1\Rodrigo\CONFIG~1\Temp\Rar$DI89.808\GameAnarchy.pwn(22455) : error 078: function uses both "return" and "return <value>"
C:\DOCUME~1\Rodrigo\CONFIG~1\Temp\Rar$DI89.808\GameAnarchy.pwn(22464) : error 078: function uses both "return" and "return <value>"
C:\DOCUME~1\Rodrigo\CONFIG~1\Temp\Rar$DI89.808\GameAnarchy.pwn(22467) : error 078: function uses both "return" and "return <value>"
C:\DOCUME~1\Rodrigo\CONFIG~1\Temp\Rar$DI89.808\GameAnarchy.pwn(22477) : error 078: function uses both "return" and "return <value>"
C:\DOCUME~1\Rodrigo\CONFIG~1\Temp\Rar$DI89.808\GameAnarchy.pwn(22482) : error 078: function uses both "return" and "return <value>"
C:\DOCUME~1\Rodrigo\CONFIG~1\Temp\Rar$DI89.808\GameAnarchy.pwn(22487) : error 078: function uses both "return" and "return <value>"
C:\DOCUME~1\Rodrigo\CONFIG~1\Temp\Rar$DI89.808\GameAnarchy.pwn(22492) : error 078: function uses both "return" and "return <value>"
C:\DOCUME~1\Rodrigo\CONFIG~1\Temp\Rar$DI89.808\GameAnarchy.pwn(22497) : error 078: function uses both "return" and "return <value>"
C:\DOCUME~1\Rodrigo\CONFIG~1\Temp\Rar$DI89.808\GameAnarchy.pwn(22502) : error 078: function uses both "return" and "return <value>"
C:\DOCUME~1\Rodrigo\CONFIG~1\Temp\Rar$DI89.808\GameAnarchy.pwn(22507) : error 078: function uses both "return" and "return <value>"

Compilation aborted.Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


26 Errors.
Reply
#9

vixi entao nem sei resolver espera os outros ae
eu costumo fazer e testar o codigo em um gm que eu tenho aki e esse ae
alem e strcmp eu uso zcmd e outra tem muitas defines e para mim testar esses codigo teria que add varias coisas aki no gm
entao espera o outro ae !
Reply
#10

Quote:
Originally Posted by billy the kid
Посмотреть сообщение
vixi entao nem sei resolver espera os outros ae
eu costumo fazer e testar o codigo em um gm que eu tenho aki e esse ae
alem e strcmp eu uso zcmd e outra tem muitas defines e para mim testar esses codigo teria que add varias coisas aki no gm
entao espera o outro ae !
Tem alguem ai pra ajuda pfv?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)