[Help]Unknown command
#1

Has a command on my server that works fine
but from this:



the command is this:

Код:
if(strcmp(cmd, "/alugarcarro", true) == 0)
	{
			if(GetPlayerVehicleID(playerid) >= 372 && GetPlayerVehicleID(playerid) <= 377)
			{
				new hirefee = HireCost(GetPlayerVehicleID(playerid));
				if (GetPlayerMoney(playerid) <  500)
				{
					SendClientMessage(playerid, COLOR_GRAD2, "   Vocк nгo tem dinheiro suficiente para alugar esse carro !");
					return 1;
				}
				if(HireCar[playerid] != 299)
				{
					gCarLock[HireCar[playerid]] = 0;
					UnLockCar(HireCar[playerid]);
					SendClientMessage(playerid, COLOR_GREY, "Vocк precisa desalugar seu carro/moto/barco primeiro !");
					return 1;
				}
				for(new i=0; i<MAX_PLAYERS; i++)
				{
				    if(HireCar[i] == GetPlayerVehicleID(playerid))
				    {
				        SendClientMessage(playerid, COLOR_GREY, "    Alguйm ja alugou esse carro !");
				        return 1;
				    }
				}
				SafeGivePlayerMoney(playerid,-500);
				SBizzInfo[14][sbTill] += 500;
				ExtortionSBiz(14, SBizzInfo[14][sbEntranceCost]);
				SBizzInfo[14][sbProducts]--;
				HireCar[playerid] = GetPlayerVehicleID(playerid);
				OnPropUpdate();
				PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
				format(string, sizeof(string), "~w~Nao se esqueca de ~r~/desalugarcarro~n~~g~/fechar ~w~para travar seu carro.",hirefee);
				TogglePlayerControllable(playerid, 1);
				gEngine[GetPlayerVehicleID(playerid)] = 1;
				GameTextForPlayer(playerid, string, 5000, 3);
                }
			    else
			    {
			        SendClientMessage(playerid, COLOR_GREY,"Voce Nгo esta No Carros da empresa de aluguel!");
			        return 0;
		}
		return 1;
	}
Anyone know why?
Reply
#2

i thinks its because pawno isnt reading it properly eu sou pt sei falar br e pt mas ingles para perceberem
you may need to swap the order of it
Reply
#3

Delete the return 1; at the very end of OnPlayerCommandText and put this in place of it
pawn Код:
else
    {
        return 1;
    }
Reply
#4

FireCat, wtf that shit don't exist!
Reply
#5

Try returning 1, instead of 0.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)