Jump to content

Help needed


Unique23

Recommended Posts

Hello Everyone!

I decided to improve my Box skills script.I want script to show players the tactics when players buy a skill.

Here is my script

Server Side

  
function learnboxx() 
    local money = getPlayerMoney(source)                            
    if (money >=250) then     
    takePlayerMoney(source,250)  
    local status = setPlayerFightingStyle ( source, 5 ) 
    outputChatBox ("You have succesfully bought Box skills",source,255,255,0) 
    triggerClientEvent("oyuncuyaboxogret",source) 
    else 
    outputChatBox ("Sorry,You don't have enough money to buy this skill.!",source,255,255,0) 
    end 
end 
  
addEvent("learnbox",true) 
addEventHandler("learnbox", root, learnboxx) 
  

This is my Client Side

  
function boxogret() 
setTimer( function(player) 
setPedAnimation(player,"FIGHT_B","FightB_2") 
end,5000,1) 
end 
addEvent( "oyuncuyaboxogret", true ) 
addEventHandler( "oyuncuyaboxogret", getLocalPlayer(), boxogret ) 
  

MTA gives a Bad Argument warning at line 4 in client side.Thanks in advance

Link to comment
  • Moderators

For instance, you just forgot to send the player argument which is the source of the event in the setTimer.

So you had to add source after

5000, 1 

But it's useless to use a function when there is only one instruction in it. So use the Solidsnake's code instead.

Link to comment

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...