28.02.2013, 12:23
(
Last edited by Arpatos; 01/03/2013 at 09:56 AM.
)
Hey dudes, i've scripted a little part of my gamemode in order to put on lights with a key:
if((newkeys == KEY_SUBMISSION) || (newkeys & KEY_SPRINT) && (newkeys & KEY_SUBMISSION) || (newkeys & KEY_UP) && (newkeys & KEY_SUBMISSION) || (newkeys & KEY_DOWN) && (newkeys & KEY_SUBMISSION) || (newkeys & KEY_WALK) && (newkeys & KEY_SUBMISSION) || (newkeys & KEY_LEFT) && (newkeys & KEY_SUBMISSION) || (newkeys & KEY_RIGHT) && (newkeys & KEY_SUBMISSION))
{
if(IsPlayerConnected(playerid))
{
if(IsPlayerInAnyVehicle(playerid))
{
new vehicleid = GetPlayerVehicleID(playerid);
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
new engine,lights,alarm,doors,bonnet,boot,objective;
GetVehicleParamsEx(vehicleid,engine,lights,alarm,d oors,bonnet,boot,objective);
if(PharesAllumer[vehicleid] == 0)
{
SetVehicleParamsEx(vehicleid,engine,VEHICLE_PARAMS _ON,alarm,doors,bonnet,boot,objective);
PharesAllumer[vehicleid] = 1;
}
}
}
}
}
But how to do, in order to put off the lights with the same key ?
if((newkeys == KEY_SUBMISSION) || (newkeys & KEY_SPRINT) && (newkeys & KEY_SUBMISSION) || (newkeys & KEY_UP) && (newkeys & KEY_SUBMISSION) || (newkeys & KEY_DOWN) && (newkeys & KEY_SUBMISSION) || (newkeys & KEY_WALK) && (newkeys & KEY_SUBMISSION) || (newkeys & KEY_LEFT) && (newkeys & KEY_SUBMISSION) || (newkeys & KEY_RIGHT) && (newkeys & KEY_SUBMISSION))
{
if(IsPlayerConnected(playerid))
{
if(IsPlayerInAnyVehicle(playerid))
{
new vehicleid = GetPlayerVehicleID(playerid);
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
new engine,lights,alarm,doors,bonnet,boot,objective;
GetVehicleParamsEx(vehicleid,engine,lights,alarm,d oors,bonnet,boot,objective);
if(PharesAllumer[vehicleid] == 0)
{
SetVehicleParamsEx(vehicleid,engine,VEHICLE_PARAMS _ON,alarm,doors,bonnet,boot,objective);
PharesAllumer[vehicleid] = 1;
}
}
}
}
}
But how to do, in order to put off the lights with the same key ?