Problem with vehicle params...
#1

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?
Reply
#2

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;
}
Reply
#3

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


Forum Jump:


Users browsing this thread: 1 Guest(s)