return 0 doesn't work.
#1

i got:

Код:
else if(GetPlayerVehicleID(playerid) == (603,506,401,406,407,408,416,420,423,425,427,428,430,431,432,433,437,438,442,443,452,453,454,464,465,470,472,473,484,485,486,490,493,497,501,514,515,520,523,524,525,528,530,531,532,534,535,536,537,538,544,552,556,557,564,569,570,574,582,596,595,597,598,599,601))
		{
			SendClientMessage(playerid,COLOR_ORANGE,"[INFO] Atsiprasome sito autmobilio nesuperkame.");
			TogglePlayerControllable(playerid,true);
			return 0;
		}
It should write the message above but instead of writing it it continues to read the below code and it gives money+exp writes a message that car successfully sold but it should write whats above.
Reply
#2

pawn Код:
else if(GetPlayerVehicleID(playerid) == (603,506,401,406,407,408,416,420,423,425,427,428,430,431,432,433,437,438,442,443,452,453,454,464,465,470,472,473,484,485,486,490,493,497,501,514,515,520,523,524,525,528,530,531,532,534,535,536,537,538,544,552,556,557,564,569,570,574,582,596,595,597,598,599,601))
        {
            SendClientMessage(playerid,COLOR_ORANGE,"[INFO] Atsiprasome sito autmobilio nesuperkame.");
            TogglePlayerControllable(playerid,true);
            return 1;
        }
IF ITS A COMMAND.
pawn Код:
else if(GetPlayerVehicleID(playerid) == (603,506,401,406,407,408,416,420,423,425,427,428,430,431,432,433,437,438,442,443,452,453,454,464,465,470,472,473,484,485,486,490,493,497,501,514,515,520,523,524,525,528,530,531,532,534,535,536,537,538,544,552,556,557,564,569,570,574,582,596,595,597,598,599,601))
        {
            SendClientMessage(playerid,COLOR_ORANGE,"[INFO] Atsiprasome sito autmobilio nesuperkame.");
            TogglePlayerControllable(playerid,true);
              return 1;
        }
            return 0;
        }
Reply
#3

Invalid statement, use a switch.
Reply
#4

Quote:
Originally Posted by 0rb
Invalid statement, use a switch.
what do you mean?

Abernethy: I got a menu.
Reply
#5

He means you should use this:

pawn Код:
switch(GetVehicleModel(GetPlayerVehicleID(playerid)))
{
    case 603,506,401,406,407,408,416,420,423,425,427,428,430,431,432,433,437,438,442,443,452,453,454,464,465,470,472,473,484,485,486,490,493,497,501,514,515,520,523,524,525,528,530,531,532,534,535,536,537,538,544,552,556,557,564,569,570,574,582,596,595,597,598,599,601:
    {
        //do stuff
    }
}
Also notice that you need GetVehicleModel not GetPlayerVehicleID
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)