[Ajuda] Pequeno problema
#1

Entгo, to com um pequeno problema aqui no meu GameMod,
Код HTML:
if(strcmp(cmd, "/veh", true) == 0)
{
if(PlayerInfo[playerid][pAdmin] >= 1 || PlayerInfo[playerid][pFrente] >= 1 || PlayerInfo[playerid][pGangster] >= 1) return SendClientMessage(playerid,-1,"N TEM ACESSO.");
{
SendClientMessage(playerid,-1,"NINGUEM QUE SABE");
}
return 1;
}
Esse comando nгo funciona nem para os administradores nem para os players... Aparece "Nгo tem acesso".
Reply
#2

Tente esse:
pawn Код:
if(strcmp(cmd, "/veh", true) == 0)
{
if(PlayerInfo[playerid][pAdmin] < 1 ) return SendClientMessage(playerid,-1,"N TEM ACESSO.");
{
SendClientMessage(playerid,-1,"NINGUEM QUE SABE");
}
return 1;
}
OBS: Sу admin vai ter acesso.
Reply
#3

Tenta esse
Код:
    if(strcmp(cmd, "/veh", true) == 0)
    {
		if(IsPlayerConnected(playerid))
     	{
        	if (PlayerInfo[playerid][pAdmin] < 1)
			{
		    	SendClientMessage(playerid, COLOR_GRAD1, "   Vocк nгo esta autorizado a usar este comando!");
       			return 1;
			}
			if(CreatedCar >= 200)
    		{
    			SendClientMessage(playerid, COLOR_GRAD1, "Jб criaram muitos carros, destrua alguns primeiro /destruirid");
    			return 1;
    		}
  			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
   			{
    			SendClientMessage(playerid, COLOR_GRAD2, "USE: /veh [IDCARRO] [COR1] [COR2]");
    			return 1;
   			}
   			new car;
   			car = strval(tmp);
   			if(car < 400 || car > 611) { SendClientMessage(playerid, COLOR_GREY, "   Modelo Do Carro Tem Que Ser Entre 411 e 600 !"); return 1; }
   			tmp = strtok(cmdtext, idx);
   			if(!strlen(tmp))
   			{
    			SendClientMessage(playerid, COLOR_GRAD2, "USE: /veh [IDCARRO] [COR1] [COR2]");
    			return 1;
   			}
   			new COLOR1;
   			COLOR1 = strval(tmp);
   			if(COLOR1 < 0 || COLOR1 > 236) { SendClientMessage(playerid, COLOR_GREY, "   Nъmero Da Cor tem que ser entre 0 e 126 !"); return 1; }
   			tmp = strtok(cmdtext, idx);
   			if(!strlen(tmp))
   			{
    			SendClientMessage(playerid, COLOR_GRAD2, "USE: /veh [IDCARRO] [COR1] [COR2]");
    			return 1;
   			}
   			new COLOR2;
   			COLOR2 = strval(tmp);
   			if(COLOR2 < 0 || COLOR2 > 236) { SendClientMessage(playerid, COLOR_GREY, "   Nъmero Da Cor tem que ser entre 0 e 126 !"); return 1; }
   			new Float:X,Float:Y,Float:Z;
   			GetPlayerPos(playerid, X,Y,Z);
   			new carid = CreateVehicle(car, X,Y,Z, 0.0, COLOR1, COLOR2, 60000);
   			CreatedCars[CreatedCar] = carid;
   			CreatedCar ++;
   			format(string, sizeof(string), "   Veiculo %d Criado.", carid);
   			SendClientMessage(playerid, COLOR_GREY, string);
  		}
  		return 1;
 	}
Ajudei ? +rep
Reply
#4

Vinicius vocк nгo ajudo sу copio o cуdigo pronto de algum gamemode.
Reply
#5

Creio que seja isso:

PHP код:
if(!strcmp(cmd"/veh"true)) {
    if(
PlayerInfo[playerid][pAdmin] >= || PlayerInfo[playerid][pFrente] >= || PlayerInfo[playerid][pGangster] >= 1) {
        
SendClientMessage(playerid,-1,"NINGUEM QUE SABE");
    } else 
SendClientMessage(playerid,-1,"N TEM ACESSO.");
    return 
1;

Reply
#6

Isso mesmo paulo, obg.
Tinha esquecido de usar Else.
Reply
#7

Quote:
Originally Posted by paulor
Посмотреть сообщение
Creio que seja isso:

PHP код:
if(!strcmp(cmd"/veh"true)) {
    if(
PlayerInfo[playerid][pAdmin] >= || PlayerInfo[playerid][pFrente] >= || PlayerInfo[playerid][pGangster] >= 1) {
        
SendClientMessage(playerid,-1,"NINGUEM QUE SABE");
    } else 
SendClientMessage(playerid,-1,"N TEM ACESSO.");
    return 
1;

PHP код:
pergunta atoa 
esse codigos tipo
teste
()
{
    
teste()
   {
           
teste()
          {
          }
    }
}
//acima e indentado
teste(){
    
teste(){
           
teste(){
          }
    }
}
//desse modo acima e otimizado ? 
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)