• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
wrong number of parameters
#1
Hi, im trying some examples from wiki.

The code below always throw an error:

function drawLocalName()
{
    local position = getPlayerPosition( getLocalPlayer() );
    local screen   = getScreenFromWorld( position[0], position[1], position[2] );
    if(screen[2] >= 0)
    {
      //dxDrawText( "Hello world!", screen[0], screen[1], 0xFFFFFFFF, true, "tahoma-bold" );
    }
}
addEventHandler( "onClientFrameRender", drawLocalName );

[19:59:20] Script Error: AN ERROR HAS OCCURED [wrong number of parameters]
[19:59:20] Script Error: CALLSTACK
[19:59:20] Script Error: LOCALS

Do you have any advice?
  Reply
#2
Try this:

getPlayerPosition( getLocalPlayer() ) -> getPlayerPosition()
  Reply
#3
Does not work, the same error
  Reply
#4
Your problem is in callback arguments.
Instead of drawLocalName() use drawLocalName(post)
Event has an argument that passes in callback http://wiki.mafia2-online.com/index.php/...rameRender
  Reply
#5
Yeah, Thank you, now, it is working great Smile Devs should definitely edit wiki examples to be up-to-date.
  Reply


Forum Jump:


Users browsing this thread: