SA-MP Forums Archive
return 0 doesn't work. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: return 0 doesn't work. (/showthread.php?tid=80907)



return 0 doesn't work. - Gamer007 - 07.06.2009

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.



Re: return 0 doesn't work. - Abernethy - 07.06.2009

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;
        }



Re: return 0 doesn't work. - yom - 07.06.2009

Invalid statement, use a switch.


Re: return 0 doesn't work. - Gamer007 - 07.06.2009

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

Abernethy: I got a menu.


Re: return 0 doesn't work. - Weirdosport - 07.06.2009

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