Jump to content

help please!?


Kenix

Recommended Posts

I want to make a script to keep waepon skill the player but it doesn't work looked on wiki hasn't helped.

  
function playerLogin (thePreviousAccount, theCurrentAccount, autoLogin) 
  if  not (isGuestAccount (getPlayerAccount (source))) then 
      local stat = getAccountData (theCurrentAccount, "funmodev2-stat") 
    end    
  end 
addEventHandler ("onPlayerLogin", getRootElement(), playerLogin) 
  
function onQuit (quitType, reason, responsibleElement) 
  if not (isGuestAccount (getPlayerAccount (source))) then 
    account = getPlayerAccount (source) 
    if (account) then 
      setAccountData (account, "funmodev2-stat", tostring (GetPlayerStat (source))) 
    end 
  end 
end 
addEventHandler ("onPlayerQuit", getRootElement(), onQuit) 
  

Link to comment

When you used "onPlayerLogin" whats the point of using not (isGuestAccount(getPlayerAccount(source))

stat is not a string, why using tostring?

the function GetPlayerStat is wrong, use getPedStat

At function, why are you using all of the arguments? when you don't need even 1 of them.

use

  
function playerLogin () 
and 
function onQuit () 

on the first function, you are getting the stat but not making it to set, lmao...

You'll have to make different data(s) for each weapon.

Link to comment
  
function playerLogin () 
  if  not (isGuestAccount (getPlayerAccount (source))) then 
      local statID0 = getAccountData (theCurrentAccount, "funmodev2-statID0") 
      local statID1 = getAccountData (theCurrentAccount, "funmodev2-statID1") 
      local statID2 = getAccountData (theCurrentAccount, "funmodev2-statID2") 
      local statID3 = getAccountData (theCurrentAccount, "funmodev2-statID3") 
      local statID4 = getAccountData (theCurrentAccount, "funmodev2-statID4") 
      local statID5 = getAccountData (theCurrentAccount, "funmodev2-statID5") 
      local statID6 = getAccountData (theCurrentAccount, "funmodev2-statID6") 
      local statID7 = getAccountData (theCurrentAccount, "funmodev2-statID7") 
      local statID8 = getAccountData (theCurrentAccount, "funmodev2-statID8") 
      local statID9 = getAccountData (theCurrentAccount, "funmodev2-statID9") 
      local statID10 = getAccountData (theCurrentAccount, "funmodev2-statID10") 
      local statID11 = getAccountData (theCurrentAccount, "funmodev2-statID11") 
      local statID12 = getAccountData (theCurrentAccount, "funmodev2-statID12") 
    end    
  end 
addEventHandler ("onPlayerLogin", getRootElement(), playerLogin) 
  
function onQuit () 
  if not (isGuestAccount (getPlayerAccount (source))) then 
    account = getPlayerAccount (source) 
    if (account) then 
      setAccountData (account, "funmodev2-statID0", GetPlayerStat (source, 0))  
      setAccountData (account, "funmodev2-statID1", GetPlayerStat (source, 1)) 
      setAccountData (account, "funmodev2-statID2", GetPlayerStat (source, 2)) 
      setAccountData (account, "funmodev2-statID3", GetPlayerStat (source, 3)) 
      setAccountData (account, "funmodev2-statID4", GetPlayerStat (source, 4)) 
      setAccountData (account, "funmodev2-statID5", GetPlayerStat (source, 5)) 
      setAccountData (account, "funmodev2-statID6", GetPlayerStat (source, 6)) 
      setAccountData (account, "funmodev2-statID7", GetPlayerStat (source, 7)) 
      setAccountData (account, "funmodev2-statID8", GetPlayerStat (source,)  
      setAccountData (account, "funmodev2-statID9", GetPlayerStat (source, 9)) 
      setAccountData (account, "funmodev2-statID10", GetPlayerStat (source, 10)) 
      setAccountData (account, "funmodev2-statID11", GetPlayerStat (source, 11)) 
      setAccountData (account, "funmodev2-statID12", GetPlayerStat (source, 12)) 
    end 
  end 
end 
addEventHandler ("onPlayerQuit", getRootElement(), onQuit) 
  

bad argument 3-15 lines =(

Edited by Guest
Link to comment

READ THIS CAREFULLY,

When you used "onPlayerLogin" whats the point of using not (isGuestAccount(getPlayerAccount(source))

stat is not a string, why using tostring?

the function GetPlayerStat is wrong, use getPedStat

on the first function, you are getting the stat but not making it to set, lmao...

You'll have to make different data(s) for each weapon.

Seriously, Is this a joke?

<!-- s8) --><img src=\"{SMILIES_PATH}/icon_cool.gif\" alt=\"8)\" title=\"Cool\" /><!-- s8) -->) 

Link to comment

oops, look out! just corrected an error

  
  
function playerLogin () 
      local statID0 = getAccountData (getPlayerAccount(source), "funmodev2-statID0") 
      local statID1 = getAccountData (getPlayerAccount(source), "funmodev2-statID1") 
      local statID2 = getAccountData (getPlayerAccount(source), "funmodev2-statID2") 
      local statID3 = getAccountData (getPlayerAccount(source), "funmodev2-statID3") 
      local statID4 = getAccountData (getPlayerAccount(source), "funmodev2-statID4") 
      local statID5 = getAccountData (getPlayerAccount(source), "funmodev2-statID5") 
      local statID6 = getAccountData (getPlayerAccount(source), "funmodev2-statID6") 
      local statID7 = getAccountData (getPlayerAccount(source), "funmodev2-statID7") 
      local statID8 = getAccountData (getPlayerAccount(source), "funmodev2-statID8") 
      local statID9 = getAccountData (getPlayerAccount(source), "funmodev2-statID9") 
      local statID10 = getAccountData (getPlayerAccount(source), "funmodev2-statID10") 
      setPedStat ( source, 69, statID0 ) 
      setPedStat ( source, 70, statID1 ) 
      setPedStat ( source, 71, statID2 ) 
      setPedStat ( source, 72, statID3 ) 
      setPedStat ( source, 73, statID4 ) 
      setPedStat ( source, 74, statID5 ) 
      setPedStat ( source, 75, statID6 ) 
      setPedStat ( source, 76, statID7 ) 
      setPedStat ( source, 77, statID8 ) 
      setPedStat ( source, 78, statID9 ) 
      setPedStat ( source, 79, statID10 ) 
  end 
addEventHandler ("onPlayerLogin", getRootElement(), playerLogin) 
  
function onQuit () 
  if not (isGuestAccount (getPlayerAccount (source))) then 
    account = getPlayerAccount (source) 
    if (account) then 
      setAccountData (account, "funmodev2-statID0", getPedStat (source, 69)) 
      setAccountData (account, "funmodev2-statID1", getPedStat (source,70)) 
      setAccountData (account, "funmodev2-statID2", getPedStat (source, 71)) 
      setAccountData (account, "funmodev2-statID3", getPedStat (source,72)) 
      setAccountData (account, "funmodev2-statID4", getPedStat (source, 73)) 
      setAccountData (account, "funmodev2-statID5", getPedStat (source, 74)) 
      setAccountData (account, "funmodev2-statID6", getPedStat (source, 75)) 
      setAccountData (account, "funmodev2-statID7", getPedStat (source, 76)) 
      setAccountData (account, "funmodev2-statID8", getPedStat (source,77)) 
      setAccountData (account, "funmodev2-statID9", getPedStat (source, 78)) 
      setAccountData (account, "funmodev2-statID10", getPedStat (source, 79)) 
    end 
  end 
end 
addEventHandler ("onPlayerQuit", getRootElement(), onQuit) 
  

Edited by Guest
Link to comment
  
function playerLogin (prev, current, auto) 
      local statID0 = getAccountData (current, "funmodev2-statID0") 
      local statID1 = getAccountData (current, "funmodev2-statID1") 
      local statID2 = getAccountData (current, "funmodev2-statID2") 
      local statID3 = getAccountData (current, "funmodev2-statID3") 
      local statID4 = getAccountData (current, "funmodev2-statID4") 
      local statID5 = getAccountData (current, "funmodev2-statID5") 
      local statID6 = getAccountData (current, "funmodev2-statID6") 
      local statID7 = getAccountData (current, "funmodev2-statID7") 
      local statID8 = getAccountData (current, "funmodev2-statID8") 
      local statID9 = getAccountData (current, "funmodev2-statID9") 
      local statID10 = getAccountData (current, "funmodev2-statID10") 
  

will be a bit less CPU consuming. Probably you will never see difference - but it's better to learn scripting in proper way :)

Link to comment

I have made new skill but an error

Error when I use skill

To one weapon on 3 skills

  
addEvent ("view", true) 
function showGui (hitPlayer, matchingDimension) 
    triggerClientEvent ("view", hitPlayer) 
end 
addCommandHandler("skill",showGui) 
  
function skillButton (id, cost) 
  if (id == "0") then 
    skillBuyPlayer (250,source,69) 
     if ( stat > 40 ) then ----//error 
        elseif (id == "1") then ----//error 
    skillBuyPlayer (1000,source,69) 
        if ( stat > 400 ) then 
        elseif (id == "2") then ----//error 
        if ( stat > 999 ) then 
    skillBuyPlayer (3000,source,69)                         
        elseif (id == "3") then   ----//error 
        if ( stat > 200 ) then 
    skillBuyPlayer (2000,source,71) 
        elseif (id == "4") then   ----//error 
        if ( stat > 500 ) then 
    skillBuyPlayer (4000,source,71) 
        elseif (id == "5") then   ----//error 
        if ( stat > 999 ) then 
    skillBuyPlayer (6000,source,71) 
        elseif (id == "6") then   ----//error 
        if ( stat > 200 ) then 
    skillBuyPlayer (2500,source,72) 
        elseif (id == "7") then   ----//error 
        if ( stat > 450 ) then 
    skillBuyPlayer (5500,source,72) 
        elseif (id == "8") then   ----//error 
        if ( stat > 999 ) then 
    skillBuyPlayer (7500,source,72) 
        elseif (id == "9") then   ----//error 
        if ( stat > 200 ) then 
    skillBuyPlayer (4000,source,73) 
        elseif (id == "10") then   ----//error 
        if ( stat > 450 ) then 
    skillBuyPlayer (6000,source,73) 
        elseif (id == "11") then   ----//error 
        if ( stat > 999 ) then 
    skillBuyPlayer (9000,source,73) 
        elseif (id == "12") then   ----//error 
        if ( stat > 200 ) then 
    skillBuyPlayer (8000,source,74) 
        elseif (id == "13") then   ----//error 
        if ( stat > 450 ) then 
    skillBuyPlayer (9000,source,74) 
        elseif (id == "14") then   ----//error 
        if ( stat > 999 ) then 
    skillBuyPlayer (12000,source,74) 
        elseif (id == "15") then   ----//error 
        if ( stat > 50 ) then 
    skillBuyPlayer (20000,source,75) 
        elseif (id == "16") then   ----//error 
        if ( stat > 450 ) then 
    skillBuyPlayer (16000,source,75) 
        elseif (id == "17") then   ----//error 
        if ( stat > 999 ) then 
    skillBuyPlayer (21000,source,75) 
        elseif (id == "18") then   ----//error 
        if ( stat > 250 ) then 
    skillBuyPlayer (12000,source,76) 
        elseif (id == "19") then   ----//error 
        if ( stat > 500 ) then 
    skillBuyPlayer (18000,source,76) 
        elseif (id == "20") then   ----//error 
        if ( stat > 999 ) then 
    skillBuyPlayer (23000,source,76) 
        elseif (id == "21") then   ----//error 
        if ( stat > 200 ) then 
    skillBuyPlayer (15000,source,77) 
        elseif (id == "22") then   ----//error 
        if ( stat > 500 ) then 
    skillBuyPlayer (22000,source,77) 
        elseif (id == "23") then   ----//error 
        if ( stat > 999 ) then 
    skillBuyPlayer (27000,source,77) 
        elseif (id == "24") then   ----//error 
        if ( stat > 200 ) then 
    skillBuyPlayer (18000,source,78) 
        elseif (id == "25") then   ----//error 
        if ( stat > 500 ) then 
    skillBuyPlayer (25000,source,78) 
        elseif (id == "26") then   ----//error 
        if ( stat > 999 ) then 
    skillBuyPlayer (30000,source,78) 
        elseif (id == "27") then   ----//error 
        if ( stat > 300 ) then 
    skillBuyPlayer (20000,source,79) 
        elseif (id == "28") then   ----//error 
        if ( stat > 500 ) then 
    skillBuyPlayer (32000,source,79) 
        elseif (id == "29") then   ----//error 
        if ( stat > 999 ) then 
    skillBuyPlayer (42000,source,79)             
  
end 
end 
end 
end 
end 
end 
end 
end 
end 
end 
end 
end 
end 
end 
end 
end 
end 
end 
end 
end 
end 
end 
end 
end 
end 
end 
end 
end 
end 
end 
end 
end 
addEvent ("skillBuy", true) 
addEventHandler ("skillBuy", getRootElement(),skillButton) 
  
function skillBuyPlayer (cash,player,id) 
    if (getPlayerMoney (player) >= cash) then 
      takePlayerMoney (player,cash) 
      setPedStat(player, id, 0) 
    else outputChatBox ("вы слишком бедны!", player, 255,0,0) 
  end 
end 
  

Link to comment

varez script not work

  
  
addEvent ("view", true) 
function showGui (hitPlayer, matchingDimension) 
    triggerClientEvent ("view", hitPlayer) 
end 
addCommandHandler("skill",showGui) 
  
function skillButton (id, cost) 
   if ( stat > 40 ) then ----//error 
        elseif (id == "0") then ----//error 
        end 
    skillBuyPlayer (250,source,69) 
     if ( stat > 240 ) then ----//error 
        elseif (id == "1") then ----//error 
        end 
    skillBuyPlayer (1000,source,69) 
        if ( stat > 3 ) then 
        elseif (id == "2") then ----//error 
        if ( stat > 999 ) then 
        end 
    skillBuyPlayer (3000,source,69)                         
        elseif (id == "3") then   ----//error 
        if ( stat > 200 ) then 
        end 
    skillBuyPlayer (2000,source,71) 
        elseif (id == "4") then   ----//error 
        if ( stat > 500 ) then 
        end 
    skillBuyPlayer (4000,source,71) 
        elseif (id == "5") then   ----//error 
        if ( stat > 999 ) then 
        end 
    skillBuyPlayer (6000,source,71) 
        elseif (id == "6") then   ----//error 
        if ( stat > 200 ) then 
        end 
    skillBuyPlayer (2500,source,72) 
        elseif (id == "7") then   ----//error 
        if ( stat > 450 ) then 
        end 
    skillBuyPlayer (5500,source,72) 
        elseif (id == "8") then   ----//error 
        if ( stat > 999 ) then 
        end 
    skillBuyPlayer (7500,source,72) 
        elseif (id == "9") then   ----//error 
        if ( stat > 200 ) then 
        end 
    skillBuyPlayer (4000,source,73) 
        elseif (id == "10") then   ----//error 
        if ( stat > 450 ) then 
        end 
    skillBuyPlayer (6000,source,73) 
        elseif (id == "11") then   ----//error 
        if ( stat > 999 ) then 
        end 
    skillBuyPlayer (9000,source,73) 
        elseif (id == "12") then   ----//error 
        if ( stat > 200 ) then 
        end 
    skillBuyPlayer (8000,source,74) 
        elseif (id == "13") then   ----//error 
        if ( stat > 450 ) then 
        end 
    skillBuyPlayer (9000,source,74) 
        elseif (id == "14") then   ----//error 
        if ( stat > 999 ) then 
        end 
    skillBuyPlayer (12000,source,74) 
        elseif (id == "15") then   ----//error 
        if ( stat > 50 ) then 
        end 
    skillBuyPlayer (20000,source,75) 
        elseif (id == "16") then   ----//error 
        if ( stat > 450 ) then 
        end 
    skillBuyPlayer (16000,source,75) 
        elseif (id == "17") then   ----//error 
        if ( stat > 999 ) then 
        end 
    skillBuyPlayer (21000,source,75) 
        elseif (id == "18") then   ----//error 
        if ( stat > 250 ) then 
        end 
    skillBuyPlayer (12000,source,76) 
        elseif (id == "19") then   ----//error 
        if ( stat > 500 ) then 
        end 
    skillBuyPlayer (18000,source,76) 
        elseif (id == "20") then   ----//error 
        if ( stat > 999 ) then 
        end 
    skillBuyPlayer (23000,source,76) 
        elseif (id == "21") then   ----//error 
        if ( stat > 200 ) then 
        end 
    skillBuyPlayer (15000,source,77) 
        elseif (id == "22") then   ----//error 
        if ( stat > 500 ) then 
        end 
    skillBuyPlayer (22000,source,77) 
        elseif (id == "23") then   ----//error 
        if ( stat > 999 ) then 
        end 
    skillBuyPlayer (27000,source,77) 
        elseif (id == "24") then   ----//error 
        if ( stat > 200 ) then 
        end 
    skillBuyPlayer (18000,source,78) 
        elseif (id == "25") then   ----//error 
        if ( stat > 500 ) then 
        end 
    skillBuyPlayer (25000,source,78) 
        elseif (id == "26") then   ----//error 
        if ( stat > 999 ) then 
        end 
    skillBuyPlayer (30000,source,78) 
        elseif (id == "27") then   ----//error 
        if ( stat > 300 ) then 
        end 
    skillBuyPlayer (20000,source,79) 
        elseif (id == "28") then   ----//error 
        if ( stat > 500 ) then 
        end 
    skillBuyPlayer (32000,source,79) 
        elseif (id == "29") then   ----//error 
        if ( stat > 999 ) then 
        end 
    skillBuyPlayer (42000,source,79)             
  
end 
end 
addEvent ("skillBuy", true) 
addEventHandler ("skillBuy", getRootElement(),skillButton) 
  
function skillBuyPlayer (cash,player,id) 
    if (getPlayerMoney (player) >= cash) then 
      takePlayerMoney (player,cash) 
      setPedStat(player, id, 0) 
    else outputChatBox ("вы слишком бедны!", player, 255,0,0) 
  end 
end 
  
  
  

Link to comment

Dude, read what varez said. You aren't reading well. Not reading = failing in scripting ofcourse.

varez (omg wnna use capital since its first word of the sentence... MEHEH) said you should use

  
if 
elseif 
elseif 
--More elseif if needed 
end 
  

Not what you had first, and SURELY not what you have now.

Look what you got:

  
elseif 
if 
end 

Get it? :P

Link to comment

Matter is not in it where there is (if elseif end ) here in what a business

98c3dc07b73dt.jpg

And this error arises when use skill

   
      
      
    addEvent ("view", true) 
    function showGui (hitPlayer, matchingDimension) 
        triggerClientEvent ("view", hitPlayer) 
    end 
    addCommandHandler("skill",showGui) 
      
    function skillButton (id, cost) 
           if (id == "0") then ----//error 
            if ( stat > 40 ) then ----//error 
            end 
        skillBuyPlayer (250,source,69) 
            elseif (id == "1") then ----//error 
            if ( stat > 240 ) then ----//error 
            end 
        skillBuyPlayer (1000,source,69) 
            elseif (id == "2") then ----//error 
            if ( stat > 999 ) then 
            end 
        skillBuyPlayer (3000,source,69)                         
            elseif (id == "3") then   ----//error 
            if ( stat > 200 ) then 
            end 
        skillBuyPlayer (2000,source,71) 
            elseif (id == "4") then   ----//error 
            if ( stat > 500 ) then 
            end 
        skillBuyPlayer (4000,source,71) 
            elseif (id == "5") then   ----//error 
            if ( stat > 999 ) then 
            end 
        skillBuyPlayer (6000,source,71) 
            elseif (id == "6") then   ----//error 
            if ( stat > 200 ) then 
            end 
        skillBuyPlayer (2500,source,72) 
            elseif (id == "7") then   ----//error 
            if ( stat > 450 ) then 
            end 
        skillBuyPlayer (5500,source,72) 
            elseif (id == "8") then   ----//error 
            if ( stat > 999 ) then 
            end 
        skillBuyPlayer (7500,source,72) 
            elseif (id == "9") then   ----//error 
            if ( stat > 200 ) then 
            end 
        skillBuyPlayer (4000,source,73) 
            elseif (id == "10") then   ----//error 
            if ( stat > 450 ) then 
            end 
        skillBuyPlayer (6000,source,73) 
            elseif (id == "11") then   ----//error 
            if ( stat > 999 ) then 
            end 
        skillBuyPlayer (9000,source,73) 
            elseif (id == "12") then   ----//error 
            if ( stat > 200 ) then 
            end 
        skillBuyPlayer (8000,source,74) 
            elseif (id == "13") then   ----//error 
            if ( stat > 450 ) then 
            end 
        skillBuyPlayer (9000,source,74) 
            elseif (id == "14") then   ----//error 
            if ( stat > 999 ) then 
            end 
        skillBuyPlayer (12000,source,74) 
            elseif (id == "15") then   ----//error 
            if ( stat > 50 ) then 
            end 
        skillBuyPlayer (20000,source,75) 
            elseif (id == "16") then   ----//error 
            if ( stat > 450 ) then 
            end 
        skillBuyPlayer (16000,source,75) 
            elseif (id == "17") then   ----//error 
            if ( stat > 999 ) then 
            end 
        skillBuyPlayer (21000,source,75) 
            elseif (id == "18") then   ----//error 
            if ( stat > 250 ) then 
            end 
        skillBuyPlayer (12000,source,76) 
            elseif (id == "19") then   ----//error 
            if ( stat > 500 ) then 
            end 
        skillBuyPlayer (18000,source,76) 
            elseif (id == "20") then   ----//error 
            if ( stat > 999 ) then 
            end 
        skillBuyPlayer (23000,source,76) 
            elseif (id == "21") then   ----//error 
            if ( stat > 200 ) then 
            end 
        skillBuyPlayer (15000,source,77) 
            elseif (id == "22") then   ----//error 
            if ( stat > 500 ) then 
            end 
        skillBuyPlayer (22000,source,77) 
            elseif (id == "23") then   ----//error 
            if ( stat > 999 ) then 
            end 
        skillBuyPlayer (27000,source,77) 
            elseif (id == "24") then   ----//error 
            if ( stat > 200 ) then 
       ;     end 
        skillBuyPlayer (18000,source,78) 
            elseif (id == "25") then   ----//error 
            if ( stat > 500 ) then 
            end 
        skillBuyPlayer (25000,source,78) 
            elseif (id == "26") then   ----//error 
            if ( stat > 999 ) then 
            end 
        skillBuyPlayer (30000,source,78) 
            elseif (id == "27") then   ----//error 
            if ( stat > 300 ) then 
            end 
        skillBuyPlayer (20000,source,79) 
            elseif (id == "28") then   ----//error 
            if ( stat > 500 ) then 
            end 
        skillBuyPlayer (32000,source,79) 
            elseif (id == "29") then   ----//error 
            if ( stat > 999 ) then 
            end 
        skillBuyPlayer (42000,source,79)             
      
    end 
    end 
    addEvent ("skillBuy", true) 
    addEventHandler ("skillBuy", getRootElement(),skillButton) 
      
    function skillBuyPlayer (cash,player,id) 
        if (getPlayerMoney (player) >= cash) then 
          takePlayerMoney (player,cash) 
          setPedStat(player, id, 0) 
        else outputChatBox ("вы слишком бедны!", player, 255,0,0) 
      end 
    end 
      
      
      
  

fix my script please

Link to comment
fix my script please

Maybe fix your brains first pl0x? :roll: That error describes the error: You are trying to compare a number with a nil value. Nil = nothing, if you know some English. So your error is basically if 10 > nothing then, and Lua won't know what you want with 10. First store a value in the variables you are using, then use if's.

Besides that, I still recommend you to do what we said, as that will be your problem when this is fixed.

Link to comment

Guys it has almost turned out a script almost works when you buy skill money are spent, doesn't work only setpedstat.

  
   
addEvent ("view", true) 
function showGui (hitPlayer, matchingDimension) 
    triggerClientEvent ("view", hitPlayer) 
end 
addCommandHandler("skill",showGui) 
  
function skillButton (id, cost) 
       if (id == "0") then ----//error 
      if setPedStat(player, 0, 40) then 
        end 
    skillBuyPlayer (250,source,69) 
        elseif (id == "1") then ----//error 
       if setPedStat(player, 1, 240) then 
        end 
    skillBuyPlayer (1000,source,69) 
        elseif (id == "2") then ----//error 
       if setPedStat(player, 1, 240) then 
        end 
    skillBuyPlayer (3000,source,69)                  
        elseif (id == "3") then   ----//error 
         if setPedStat(player, id, 200) then 
        end 
    skillBuyPlayer (2000,source,71) 
        elseif (id == "4") then   ----//error 
         if setPedStat(player, id, 500) then 
        end 
    skillBuyPlayer (4000,source,71) 
        elseif (id == "5") then   ----//error 
         if setPedStat(player, id, 999) then 
        end 
    skillBuyPlayer (6000,source,71) 
        elseif (id == "6") then   ----//error 
        if setPedStat(player, id, 200) then 
        end 
    skillBuyPlayer (2500,source,72) 
        elseif (id == "7") then   ----//error 
        if setPedStat(player, id, 450) then 
        end 
    skillBuyPlayer (5500,source,72) 
        elseif (id == "8") then   ----//error 
         if setPedStat(player, id, 999) then 
        end 
    skillBuyPlayer (7500,source,72) 
        elseif (id == "9") then   ----//error 
         if setPedStat(player, id, 200) then 
        end 
    skillBuyPlayer (4000,source,73) 
        elseif (id == "10") then   ----//error 
        if setPedStat(player, id, 450) then 
        end 
    skillBuyPlayer (6000,source,73) 
        elseif (id == "11") then   ----//error 
        if setPedStat(player, id, 999) then 
        end 
    skillBuyPlayer (9000,source,73) 
        elseif (id == "12") then   ----//error 
        if setPedStat(player, id, 200) then 
        end 
    skillBuyPlayer (8000,source,74) 
        elseif (id == "13") then   ----//error 
        if setPedStat(player, id, 450) then 
        end 
    skillBuyPlayer (9000,source,74) 
        elseif (id == "14") then   ----//error 
        if setPedStat(player, id, 999) then 
        end 
    skillBuyPlayer (12000,source,74) 
        elseif (id == "15") then   ----//error 
        if setPedStat(player, id, 50) then 
        end 
    skillBuyPlayer (20000,source,75) 
        elseif (id == "16") then   ----//error 
         if setPedStat(player, id, 450) then 
        end 
    skillBuyPlayer (16000,source,75) 
        elseif (id == "17") then   ----//error 
        if setPedStat(player, id, 999) then 
        end 
    skillBuyPlayer (21000,source,75) 
        elseif (id == "18") then   ----//error 
        if setPedStat(player, id, 250) then 
        end 
    skillBuyPlayer (12000,source,76) 
        elseif (id == "19") then   ----//error 
        if setPedStat(player, id, 500) then 
        end 
    skillBuyPlayer (18000,source,76) 
        elseif (id == "20") then   ----//error 
        if setPedStat(player, id, 999) then 
        end 
    skillBuyPlayer (23000,source,76) 
        elseif (id == "21") then   ----//error 
        if setPedStat(player, id, 200) then 
        end 
    skillBuyPlayer (15000,source,77) 
        elseif (id == "22") then   ----//error 
        if setPedStat(player, id, 500) then 
        end 
    skillBuyPlayer (22000,source,77) 
        elseif (id == "23") then   ----//error 
        if setPedStat(player, id, 999) then 
        end 
    skillBuyPlayer (27000,source,77) 
        elseif (id == "24") then   ----//error 
         if setPedStat(player, id, 200) then 
        end 
    skillBuyPlayer (18000,source,78) 
        elseif (id == "25") then   ----//error 
        if setPedStat(player, id, 500) then 
        end 
    skillBuyPlayer (25000,source,78) 
        elseif (id == "26") then   ----//error 
         if setPedStat(player, id, 999) then 
        end 
    skillBuyPlayer (30000,source,78) 
        elseif (id == "27") then   ----//error 
        if setPedStat(player, id, 300) then 
        end 
    skillBuyPlayer (20000,source,79) 
        elseif (id == "28") then   ----//error 
        if setPedStat(player, id, 500) then 
        end 
    skillBuyPlayer (32000,source,79) 
        elseif (id == "29") then   ----//error 
        if setPedStat(player, id, 999) then 
        end 
    skillBuyPlayer (42000,source,79)             
  
  
end 
end 
addEvent ("skillBuy", true) 
addEventHandler ("skillBuy", getRootElement(),skillButton) 
  
function skillBuyPlayer (cash,player,id) 
    if (getPlayerMoney (player) >= cash) then 
      takePlayerMoney (player,cash) 
     setPedStat(player, id, 0) 
    else outputChatBox ("вы слишком бедны!", player, 255,0,0) 
  end 
end 
  
  
  
  
  
  

Link to comment

GOD, it's just useless to help you. FIX THE STATEMENTS *insert badword here*

I'm not going to do it for you, since this is something you should really be able to do on yourself. If anyone does it for you, you wouldn't learn anything from it and ask us 2 days later the same problem.

For the last time I show how it goes:

First you use IF, then ELSEIF, then ELSE if needed, then END

  
if first == second then 
     --Do something 
elseif first == third then 
    --Do something if the previous one is incorrect 
else 
    --Do something if they're all incorrect 
end --Stop the statements 
  

How hard can it be? :P

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