Job car
#1

hey, so i don't find a bug.. why i dont get message..nothing happen, player aren't removefrom car and else...



Код:
if(newstate == PLAYER_STATE_DRIVER)
 	{
		if(vehicleid >= TaxiCar[0] && vehicleid <= TaxiCar[9])
		{
	  		if(specialybe[playerid] != 5 && playerData[playerid][admin] < 4)
	    	{
		     	SendClientMessage(playerid, -1, "you cant use car..");
				Stop(playerid);
			}
			format(msg, sizeof(msg), "you can drive car, because you workin");
			SendClientMessage(playerid, -1,msg);
		 	print("Check");
Reply
#2

pawn Код:
if(newstate == PLAYER_STATE_DRIVER)
    {
                for(new i=0; i<10;i++)
                {
            if(vehicleid == TaxiCar[i])
            {
            if(specialybe[playerid] != 5 && playerData[playerid][admin] < 4)
            {
                SendClientMessage(playerid, -1, "you cant use car..");
                Stop(playerid);
            }
            format(msg, sizeof(msg), "you can drive car, because you workin");
            SendClientMessage(playerid, -1,msg);
            print("Check");
Reply
#3

Quote:
Originally Posted by ATGOggy
Посмотреть сообщение
pawn Код:
if(newstate == PLAYER_STATE_DRIVER)
    {
                for(new i=0; i<10;i++)
                {
            if(vehicleid == TaxiCar[i])
            {
            if(specialybe[playerid] != 5 && playerData[playerid][admin] < 4)
            {
                SendClientMessage(playerid, -1, "you cant use car..");
                Stop(playerid);
            }
            format(msg, sizeof(msg), "you can drive car, because you workin");
            SendClientMessage(playerid, -1,msg);
            print("Check");
Stop pasting up "solutions" without stating what they are.

I'm also sure that your for loop, will cause a problem being that the array of cars, is smaller than the for loop.
Reply
#4

Try replacing
pawn Код:
Stop(playerid);
with

pawn Код:
return Stop(playerid);

Also your code is saying that if you're level 4 or higher admin, you will also be able to use the car.
Did you run your test while not being an admin?
Reply
#5

Ye, its work, i was create just car.. but use if(vehicleid >= TaxiCar[0] && vehicleid <= TaxiCar[9])

so i just need add TaxiCar[0] = CreateVehicleEx
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)