Jump to content

account data error


Monty

Recommended Posts

why under the code give arithemtical error un account data

createBlip ( 1552.4996337891, -1677.3264160156, 15.1953125, 30 ) 
      
    function createSAPDTeam () 
        SAPDteam = createTeam ("police", 100, 149, 237) 
    end 
    addEventHandler ("onResourceStart", resourceRoot, createSAPDTeam) 
      
    function joinSAPD() 
        setPlayerTeam(source,SAPDteam) 
        setElementModel(source, 280) 
        giveWeapon ( source, 3 ) 
        setAccountData( playeraccount, "Occupation", "police") 
        outputChatBox("You are now policeman.",source,0,255,0) 
    end 
    addEvent("setSAPD", true) 
    addEventHandler("setSAPD",root,joinSAPD) 
      
    function policeJob ( attacker, attackerweapon, bodypart, loss ) 
        theTeam = getPlayerTeam ( attacker ) 
        theWL = getPlayerWantedLevel ( source ) 
        theSkin = getElementModel ( attacker ) 
        if (attackerweapon == 3) and (loss > 2 ) and (theWL > 0) then 
            if  getTeamName( theTeam ) == "police" or getTeamName( theTeam ) == "SWAT" or getTeamName( theTeam ) == "FBI" then 
                setElementPosition (source, 4076.3999023438, -1788.5, 3.511967, true) 
                theName = getPlayerName ( source ) 
                theCop = getPlayerName ( attacker )   
                outputChatBox ( "You have been jailed by "..theCop.. " for 10 seconds.", source ) 
                local playeraccount = getPlayerAccount ( attacker ) 
                arrests = getAccountData(playeraccount, "arrest") 
    setAccountData(playeraccount, "arrest", arrests + 1 ) 
                givePlayerMoney (attacker, 100) 
                setTimer ( setElementPosition, 10000, 1, source, 1544.4332275391, -1674.7698974609, 13.688399200439)       
                setPlayerWantedLevel (source, 0) 
            end 
        end 
    end 
    addEventHandler ("onPlayerDamage", getRootElement(), policeJob) 
  
  
  

Link to comment
    createBlip ( 1552.4996337891, -1677.3264160156, 15.1953125, 30 ) 
      
    function createSAPDTeam () 
        SAPDteam = createTeam ("police", 100, 149, 237) 
    end 
    addEventHandler ("onResourceStart", resourceRoot, createSAPDTeam) 
      
    function joinSAPD() 
        setPlayerTeam(source,SAPDteam) 
        setElementModel(source, 280) 
        giveWeapon ( source, 3 ) 
        setAccountData( playeraccount, "Occupation", "police") 
        outputChatBox("You are now policeman.",source,0,255,0) 
    end 
    addEvent("setSAPD", true) 
    addEventHandler("setSAPD",root,joinSAPD) 
      
    function policeJob ( attacker, attackerweapon, bodypart, loss ) 
        theTeam = getPlayerTeam ( attacker ) 
        theWL = getPlayerWantedLevel ( source ) 
        theSkin = getElementModel ( attacker ) 
        if (attackerweapon == 3) and (loss > 2 ) and (theWL > 0) then 
            if  getTeamName( theTeam ) == "police" or getTeamName( theTeam ) == "SWAT" or getTeamName( theTeam ) == "FBI" then 
                setElementPosition (source, 4076.3999023438, -1788.5, 3.511967, true) 
                theName = getPlayerName ( source ) 
                theCop = getPlayerName ( attacker )   
                outputChatBox ( "You have been jailed by "..theCop.. " for 10 seconds.", source ) 
                local playeraccount = getPlayerAccount ( attacker ) 
                arrests = tonumber(getAccountData(playeraccount, "arrest")) 
                setAccountData(playeraccount, "arrest", arrests + 1 ) 
                givePlayerMoney (attacker, 100) 
                setTimer ( setElementPosition, 10000, 1, source, 1544.4332275391, -1674.7698974609, 13.688399200439)       
                setPlayerWantedLevel (source, 0) 
            end 
        end 
    end 
    addEventHandler ("onPlayerDamage", getRootElement(), policeJob) 
  
  
  

Link to comment

try this:

createBlip ( 1552.4996337891, -1677.3264160156, 15.1953125, 30 ) 
      
    function createSAPDTeam () 
        SAPDteam = createTeam ("police", 100, 149, 237) 
    end 
    addEventHandler ("onResourceStart", resourceRoot, createSAPDTeam) 
      
    function joinSAPD() 
        setPlayerTeam(client,SAPDteam) 
        setElementModel(client, 280) 
        giveWeapon ( client, 3 ) 
        setAccountData( getPlayerAccount(client), "Occupation", "police") 
        outputChatBox("You are now policeman.",client,0,255,0) 
    end 
    addEvent("setSAPD", true) 
    addEventHandler("setSAPD",root,joinSAPD) 
      
    function policeJob ( attacker, attackerweapon, bodypart, loss ) 
        theTeam = getPlayerTeam ( attacker ) 
        theWL = getPlayerWantedLevel ( source ) 
        theSkin = getElementModel ( attacker ) 
        if (attackerweapon == 3) and (loss > 2 ) and (theWL > 0) then 
            if  getTeamName( theTeam ) == "police" or"SWAT"or"FBI" then 
                setElementPosition (source, 4076.3999023438, -1788.5, 3.511967) 
                theName = getPlayerName ( source ) 
                theCop = getPlayerName ( attacker )   
                outputChatBox ( "You have been jailed by "..theCop.. " for 10 seconds.", source ) 
                local playeraccount = getPlayerAccount ( attacker ) 
                arrests = getAccountData(playeraccount, "arrest") 
                setAccountData(playeraccount, "arrest", arrests + 1 ) 
                givePlayerMoney (attacker, 100) 
                setTimer ( setElementPosition, 10000, 1, source, 1544.4332275391, -1674.7698974609, 13.688399200439)       
                setPlayerWantedLevel (source, 0) 
            end 
        end 
    end 
    addEventHandler ("onPlayerDamage", getRootElement(), policeJob) 

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