CapY Posted February 1, 2012 Share Posted February 1, 2012 addEventHandler ( "onClientPlayerSelectGamemode", player, function ( gm ) if gm ~= "race" then return end --some gui t1 = setTimer ( triggerServerEvent, 12000, 1, "onPlayerRaceEnter", player ) addEventHandler ( "onClientKey", root, onPlayerClientKey ) end ) attrs = 0 function onPlayerClientKey( button, press ) if ( press and button == "F9" and attrs ~= 1) then killTimer ( t1 ) attrs = attrs + 1 --some gui stuff elseif ( press and button == "F9" and attrs == 1 ) then attrs = attrs + 1 --some gui stuff. if ( press and button == "Y" and attrs == 2 ) then triggerServerEvent ( "onPlayerRaceEnter", player ) --gui stuff elseif ( press and button == "N" and attrs == 2 ) then --gui stuff call ( getResourceFromName ( "npg_general" ), "onClientPlayerRedirectFromRace", player ) end end end When it comes to "Y" or "N" it simply doesn't do the rest of the code. Link to comment
mjau Posted February 1, 2012 Share Posted February 1, 2012 addEventHandler ( "onClientPlayerSelectGamemode", player, function ( gm ) if gm ~= "race" then return end --some gui t1 = setTimer ( triggerServerEvent, 12000, 1, "onPlayerRaceEnter", player ) addEventHandler ( "onClientKey", root, onPlayerClientKey ) end ) attrs = 0 function onPlayerClientKey( button, press ) if ( press and button == "F9" and attrs ~= 1) then killTimer ( t1 ) attrs = attrs + 1 --some gui stuff elseif ( press and button == "F9" and attrs == 1 ) then attrs = attrs + 1 --some gui stuff. elseif ( press and button == "Y" and attrs == 2 ) then triggerServerEvent ( "onPlayerRaceEnter", player ) --gui stuff elseif ( press and button == "N" and attrs == 2 ) then --gui stuff call ( getResourceFromName ( "npg_general" ), "onClientPlayerRedirectFromRace", player ) end end try this... Link to comment
CapY Posted February 1, 2012 Author Share Posted February 1, 2012 addEventHandler ( "onClientPlayerSelectGamemode", player, function ( gm ) if gm ~= "race" then return end --some gui t1 = setTimer ( triggerServerEvent, 12000, 1, "onPlayerRaceEnter", player ) addEventHandler ( "onClientKey", root, onPlayerClientKey ) end ) attrs = 0 function onPlayerClientKey( button, press ) if ( press and button == "F9" and attrs ~= 1) then killTimer ( t1 ) attrs = attrs + 1 --some gui stuff elseif ( press and button == "F9" and attrs == 1 ) then attrs = attrs + 1 --some gui stuff. elseif ( press and button == "Y" and attrs == 2 ) then triggerServerEvent ( "onPlayerRaceEnter", player ) --gui stuff elseif ( press and button == "N" and attrs == 2 ) then --gui stuff call ( getResourceFromName ( "npg_general" ), "onClientPlayerRedirectFromRace", player ) end end try this... If I'm right, you changed an "If" statement to "elseif", that didn't work though, I will fix it already, thanks anyway. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now