[Ajuda] AJUDA LIMITAR CRIAЗГO DE CARROS
#1

AJUDA? PORQUE MUITAS PESSOAS TГO CRIANDO CARRO SEM DA /DC EU QUERIA QUE SO PODE-SE CRIAR CARRO SE DELETA-SE O OUTRO 1 POR VEZ CODE ABAIXO:

Код:
 	if(strcmp(cmd, "/veh", true) == 0 || strcmp(cmd, "/ccar", true) == 0)
	{
	    GetPlayerName(playerid, sendername, sizeof(sendername));
	    PlayerInfo[playerid][pAdmin] = dini_Int(udb_encode(sendername), "level");
	    if(logged[playerid] == 1)
		{
  	if(PlayerInfo[playerid][pAdmin] >= 1  || PlayerInfo[playerid][pORG] >= 1 ||PlayerInfo[playerid][pPux] >= 1 || PlayerInfo[playerid][pREPORTER] >= 1 || PlayerInfo[playerid][pGDE] >= 1 || PlayerInfo[playerid][pBOPE] >= 1)
			{
	    		ShowMenuForPlayer(Vehicle,playerid);
	    		TogglePlayerControllable(playerid, 0);
			}
			else
			{
			    SendClientMessage(playerid, COLOR_RED, "Vocк nгo tem permissгo para usar este comando!");
			}
		}
		else
		{
		    SendClientMessage(playerid, COLOR_RED, "Vocк tem que estar logado para usar este comando!");
		}
		return 1;
Reply
#2

Testa Ae :


pawn Код:
if(strcmp(cmd, "/criarveiculo", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
        if (PlayerInfo[playerid][pAdmin] >= 1)
        {
            if(CreatedCar >= 200)
            {
                SendClientMessage(playerid, COLOR_GRAD1, "Jб criaram muitos carros, destrua alguns primeiro /destruirid");
                return true;
            }
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "USE: /criarveiculo [IDCARRO] [COR1] [COR2]");
                return true;
            }
            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 true; }
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "USE: /criarveiculo [IDCARRO] [COR1] [COR2]");
                return true;
            }
            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 true; }
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "USE: /criarveiculo [IDCARRO] [COR1] [COR2]");
                return true;
            }
            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 true; }
            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 true;
    }
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)