Hero192 Posted August 23, 2015 Posted August 23, 2015 I want when i hit the pickup the gui be visible, but this doesn't works, any one? it give warning and doesn't show the GUI, bad argument WARNING: Bad Argument @'TriggerClient Event( [Expected element at argument 3, got none] Client side: Window = guiCreateWindow(491,318,399,175,"",false) guiWindowSetSizable(Window,false) guiSetVisible(Window,false) yes = guiCreateButton(230,133,143,33,"Accept",true,Window) no = guiCreateButton(26,133,143,33,"Cancel",true,Window) addEvent("show",true) addEventHandler("show",root, function () guiSetVisible(Window,true) showCursor(true) end) Server side: WARNING: Bad Argument @'TriggerClient Event( [Expected element at argument 3, got none] local pickup = createPickup(2196.70,1677.11,12.36,3,1273,0) addEventHandler ( "onPickupHit", pickup, function( hitPlayer ) if (hitPlayer and getElementType ( hitPlayer ) == 'player' and not isPedInVehicle (hitPlayer) ) then triggerClientEvent(hitPlayer,"show") end end)
JR10 Posted August 23, 2015 Posted August 23, 2015 You didn't specify the base element parameter. Server-side: local pickup = createPickup(2196.70,1677.11,12.36,3,1273,0) addEventHandler ( "onPickupHit", pickup, function( hitPlayer ) if (hitPlayer and getElementType ( hitPlayer ) == 'player' and not isPedInVehicle (hitPlayer) ) then triggerClientEvent(hitPlayer,"show", root) end end) Business System viewtopic.php?f=108&t=35797 Notepad++ Syntax Highlighting & Auto Completion viewtopic.php?f=91&t=76726 SQLite Tutorial viewtopic.php?f=148&t=38203
Walid Posted August 23, 2015 Posted August 23, 2015 Note: To save client CPU, you should avoid setting sourceElement to the root element where possible. Using resourceRoot is usually sufficient if the event is handled by the same resource on the client. addEventHandler ( "onPickupHit", pickup, function( hitPlayer ) if (hitPlayer and getElementType ( hitPlayer ) == 'player' and not isPedInVehicle (hitPlayer) ) then triggerClientEvent(hitPlayer,"show", hitPlayer) end end) Do not yield your back to your enemy, might feel something strange in your ass. Two things are infinite the universe and human stupidity and i'm not sure about the universe. UF: IsTextInGridList | GetGridListRowIndexFromText | Table.removeValue | removeHex | dxDrawTriangle Skype: SaSuki102 | About Me | Youtube channel | Lua Tips & Tricks | Lua Strings | Lua Tables | Lua Operators
JR10 Posted August 23, 2015 Posted August 23, 2015 This is probably right, however, it's different from your code. Business System viewtopic.php?f=108&t=35797 Notepad++ Syntax Highlighting & Auto Completion viewtopic.php?f=91&t=76726 SQLite Tutorial viewtopic.php?f=148&t=38203
Hero192 Posted August 23, 2015 Author Posted August 23, 2015 Thanks both of you , i understood my problem
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