Jump to content

onPlayerWasted error


myyusuf

Recommended Posts

I get the feeling this script is stolen.... :roll:

no way. i just took xml connection from nextreme's userpanel. other things writted by me. also i am not good at lua. i started last week.

3hjjn.png

so? can you help me please? :?

Edited by Guest
Link to comment

@@IIYAMA , please stop making these affirmations just for posts.

ON : Try to replace these :

  
local puan = tonumber ( loadPlayerData( player_Wasted, "points" ) ) or 0 

Full code :

function bastardDied( player_Wasted ) 
        local rank = getPlayerRank( player_Wasted ) 
  
        if (rank == 2) then 
  
            local pointsToDie = 5 
            local playerPoints = tonumber">tonumber">tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints + pointsToDie )     
            outputChatBox ( "#c0c0c0* #abcdef"..string.gsub(getPlayerName (player_Wasted),"#%x%x%x%x%x%x","").." #c0c0c0has finished this round in second place and got #abcdef5 #c0c0c0points!", root, 255, 255, 255, true ) 
    
    elseif(rank == 3) then 
  
  
            local pointsToDie = 3 
            local playerPoints = tonumber ( loadPlayerData( player_Wasted, "points" ) ) or 0 
            savePlayerData( player_Wasted, "points", playerPoints + pointsToDie )     
            outputChatBox ( "#c0c0c0* #abcdef"..string.gsub(getPlayerName (player_Wasted),"#%x%x%x%x%x%x","").." #c0c0c0has finished this round in third place and got #abcdef3 #c0c0c0points!", root, 255, 255, 255, true ) 
  
  
        elseif(rank > 3 and rank < 31) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber ( loadPlayerData( player_Wasted, "points" ) ) or 0 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
  
        end 
end 
addEventHandler("onPlayerWasted", getRootElement(), bastardDied) 

Btw , loadPlayerData and savePlayerData are definied ? I doubt this.

Link to comment
@@IIYAMA , please stop making these affirmations just for posts.

ON : Try to replace these :

  
local puan = tonumber ( loadPlayerData( player_Wasted, "points" ) ) or 0 

Full code :

function bastardDied( player_Wasted ) 
        local rank = getPlayerRank( player_Wasted ) 
  
        if (rank == 2) then 
  
            local pointsToDie = 5 
            local playerPoints = tonumber">tonumber">tonumber ( loadPlayerData( player_Wasted, "points" ) ) 
            savePlayerData( player_Wasted, "points", playerPoints + pointsToDie )     
            outputChatBox ( "#c0c0c0* #abcdef"..string.gsub(getPlayerName (player_Wasted),"#%x%x%x%x%x%x","").." #c0c0c0has finished this round in second place and got #abcdef5 #c0c0c0points!", root, 255, 255, 255, true ) 
    
    elseif(rank == 3) then 
  
  
            local pointsToDie = 3 
            local playerPoints = tonumber ( loadPlayerData( player_Wasted, "points" ) ) or 0 
            savePlayerData( player_Wasted, "points", playerPoints + pointsToDie )     
            outputChatBox ( "#c0c0c0* #abcdef"..string.gsub(getPlayerName (player_Wasted),"#%x%x%x%x%x%x","").." #c0c0c0has finished this round in third place and got #abcdef3 #c0c0c0points!", root, 255, 255, 255, true ) 
  
  
        elseif(rank > 3 and rank < 31) then 
  
            local pointsToDie = 1 
            local playerPoints = tonumber ( loadPlayerData( player_Wasted, "points" ) ) or 0 
            savePlayerData( player_Wasted, "points", playerPoints - pointsToDie )     
            outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) 
    
  
        end 
end 
addEventHandler("onPlayerWasted", getRootElement(), bastardDied) 

Btw , loadPlayerData and savePlayerData are definied ? I doubt this.

different.

when i use that

  
local puan = tonumber ( loadPlayerData( player_Wasted, "points" ) ) or 0 

it doesnt effect to "points".

Link to comment
First parameter in event onPlayerWasted is total ammo count ( not element player ).

Read it please.

player_Wasted is number and you want get data from number? :/

oh. thanks dude. i am a idiot :D

Right , instead of

  
function bastardDied( player_Wasted ) 

use

  
function bastardDied() 

And replace each "player_wasted" with "source" ..

thank you for helping too :)

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