Jump to content

Trigger problem


Hero192

Recommended Posts

Posted

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) 
  

Posted

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

Posted

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...