SA-MP Forums Archive
Argument Type Mismatch? - 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: Argument Type Mismatch? (/showthread.php?tid=209657)



Vehicle Lights Error - Antonio [G-RP] - 11.01.2011

fix.


Re: Argument Type Mismatch? - John_F - 11.01.2011

instead of using the number 1, you need a variable to store the current state of the lights in.
If you want to check if the lights are on, just do something like:
pawn Код:
new engine, lights, alarm, doors, bonnet, boot, objective;
GetVehicleParamsEx(GetVehicleID(playerid), engine, lights, alarm, doors, bonnet, boot, objective);
if(lights==1)
{
   enter code here
}



Re: Argument Type Mismatch? - Antonio [G-RP] - 11.01.2011

See, I was certain it had to look something like that, I just wasn't 100% sure how to set it up. Thanks for the help, no errors.


Re: Argument Type Mismatch? - Antonio [G-RP] - 11.01.2011

fix.


Re: Argument Type Mismatch? - _rAped - 11.01.2011

This would be enough:
pawn Код:
if(GetPlayerState(playerid) != 2) return SendClientMessage(playerid, COLOR_RED, "[ERROR] You cannot use this command while you are not the driver of a vehicle!");
GetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, boot, objective);
if(lights != 1) SetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, 1, alarm, doors, bonnet, boot, objective);
else SetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, 0, alarm, doors, bonnet, boot, objective);



Re: Argument Type Mismatch? - Antonio [G-RP] - 11.01.2011

I know, I added the messages for my own debugging purpose. I need the code fixed, not re-written.


Re: Argument Type Mismatch? - Anthonyx3' - 11.01.2011

Question, what is the problem right now? Is it that the message wont show up or the code isnt working?


Re: Argument Type Mismatch? - Kyosaur - 11.01.2011

Quote:
Originally Posted by Antonio [G-RP]
Посмотреть сообщение
fix.
Why are you editing your questions out? Even though this is a common issue, you should leave the question intact so people who have the same issue can search and find the answer :P.