SA-MP Forums Archive
Problem with vehicle params... - 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: Problem with vehicle params... (/showthread.php?tid=211635)



Problem with vehicle params... - Sascha - 15.01.2011

Hi I made a /hood /boot and /light command but none of them works..
I used this code:
Код:
dcmd_hood(playerid, params[])
{
	#pragma unused params
	if(Logged(playerid)){
	    if(IsPlayerInAnyVehicle(playerid)){
	        new vehicleid, engine, lights, alarm, doors, bonnet, boot, objective;
	        vehicleid = GetPlayerVehicleID(playerid);
	        GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
			if(bonnet == 1){
				SetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, 0, boot, objective);
			}else if(bonnet == 0){
			    SetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, 1, boot, objective);
			}
		}
	}
	return 1;
}
boot and lights are made in the same way (just that 0 and 1 are used for boot/lights)...
what's wrong?


Re: Problem with vehicle params... - Toreno - 15.01.2011

Try this:
pawn Код:
dcmd_hood(playerid, params[])
{
    #pragma unused params
    if(Logged(playerid)){
        if(IsPlayerInAnyVehicle(playerid)) {
            new vehicleid, engine, lights, alarm, doors, bonnet, boot, objective;
            vehicleid = GetPlayerVehicleID(playerid);
            GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
            if(bonnet != 1){
                SetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, 1, boot, objective);
            } else {
                SetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, 0, boot, objective);
            }
        }
    }
    return 1;
}



Re: Problem with vehicle params... - Sascha - 15.01.2011

worked, ty...
however I don't get why my version didn't work -.-