
myyusuf
Members-
Posts
120 -
Joined
-
Last visited
Everything posted by myyusuf
-
thank you. but i have a problem now. when i press f1 it shows only mouse. i cant see the gui window. GUIEditor_Window = {} GUIEditor_Button = {} GUIEditor_Label = {} GUIEditor_Image = {} showCursor ( true ) function changeVisibility ( ) if guiGetVisible ( GUIEditor_Window[1] ) then guiSetVisible ( GUIEditor_Window[1], false ) else guiSetVisible ( GUIEditor_Window[1], true ) end end GUIEditor_Window[1] = guiCreateWindow(355,249,503,303,":O| Destruction Derby Userpanel v1.01", true) setTimer ( changeVisibility, 10, 0 ) function guiToggleVisible ( ) if ( guiGetVisible ( GUIEditor_Window[1] ) == true ) then guiSetVisible ( GUIEditor_Window[1], false ) else guiSetVisible ( GUIEditor_Window[1], true ) end end GUIEditor_Window[1] = guiCreateWindow(355,249,503,303,":O| Destruction Derby Userpanel v1.01",true) bindKey ( "f1", "down", guiToggleVisible ) local playerSerial = getPlayerSerial( thePlayer ) GUIEditor_Label[1] = guiCreateLabel(20,31,196,26,"Your Stats:",false,GUIEditor_Window[1]) GUIEditor_Label[2] = guiCreateLabel(20,68,34,16,"Serial:",false,GUIEditor_Window[1]) GUIEditor_Label[9] = guiCreateLabel(58,68,287,17,"" ..playerSerial.. "",false,GUIEditor_Window[1]) GUIEditor_Label[3] = guiCreateLabel(19,99,32,17,"Wins:",false,GUIEditor_Window[1]) if GUIEditor_Label[3] then triggerServerEvent("GUIwins",getLocalPlayer()) end addEvent("GUIwins",true) addEventHandler("GUIwins",root,function(wins) if stats then GUIEditor_Label[10] = guiCreateLabel(55,100,287,17,"" ..wins.. "",false,GUIEditor_Window[1]) end end ) GUIEditor_Label[4] = guiCreateLabel(18,129,38,16,"Points:",false,GUIEditor_Window[1]) if GUIEditor_Label[4] then triggerServerEvent("GUIpoints",getLocalPlayer()) end addEvent("GUIpoints",true) addEventHandler("GUIpoints",root,function(points) if stats then GUIEditor_Label[11] = guiCreateLabel(60,129,287,17,"" ..points.. "",false,GUIEditor_Window[1]) end end ) GUIEditor_Label[5] = guiCreateLabel(17,159,83,16,"Second places:",false,GUIEditor_Window[1]) if GUIEditor_Label[5] then triggerServerEvent("GUIsecond",getLocalPlayer()) end addEvent("GUIsecond",true) addEventHandler("GUIsecond",root,function(second) if stats then GUIEditor_Label[12] = guiCreateLabel(102,159,287,17,"" ..second.. "",false,GUIEditor_Window[1]) end end ) GUIEditor_Label[6] = guiCreateLabel(16,184,73,15,"Third places:",false,GUIEditor_Window[1]) if GUIEditor_Label[6] then triggerServerEvent("GUIthird",getLocalPlayer()) end addEvent("GUIthird",true) addEventHandler("GUIthird",root,function(third) if stats then GUIEditor_Label[13] = guiCreateLabel(90,184,287,17,"" ..third.. "",false,GUIEditor_Window[1]) end end ) GUIEditor_Label[7] = guiCreateLabel(17,213,33,17,"Rank:",false,GUIEditor_Window[1]) if GUIEditor_Label[7] then triggerServerEvent("GUIrank",getLocalPlayer()) end addEvent("GUIrank",true) addEventHandler("GUIrank",root,function(rank) if stats then GUIEditor_Label[14] = guiCreateLabel(51,213,287,17,"" ..rank.. "",false,GUIEditor_Window[1]) end end ) GUIEditor_Button[1] = guiCreateButton(369,259,113,30,"Close (F3)",false,GUIEditor_Window[1]) GUIEditor_Label[8] = guiCreateLabel(384,27,114,18,"Created by |V",false,GUIEditor_Window[1]) GUIEditor_Image[1] = guiCreateStaticImage(14,249,183,37,"images/shruk.png",false,GUIEditor_Window[1])
-
thanks. no warning but it dont show stats now. and bindkey isnt working.
-
thank you for helping to me. im trying to make it someting, but it doesnt take "stats" from serverside. where am i wrong? client.lua local playerSerial = getPlayerSerial( thePlayer ) GUIEditor_Window = {} GUIEditor_Button = {} GUIEditor_Label = {} GUIEditor_Image = {} showCursor ( true ) GUIEditor_Window[1] = guiCreateWindow(355,249,503,303,":O| Destruction Derby Userpanel v1.01",false) GUIEditor_Label[1] = guiCreateLabel(20,31,196,26,"Your Stats:",false,GUIEditor_Window[1]) GUIEditor_Label[2] = guiCreateLabel(20,68,34,16,"Serial:",false,GUIEditor_Window[1]) GUIEditor_Label[9] = guiCreateLabel(58,68,287,17,"" ..playerSerial.. "",false,GUIEditor_Window[1]) GUIEditor_Label[3] = guiCreateLabel(19,99,32,17,"Wins:",false,GUIEditor_Window[1]) if GUIEditor_Label[3] then triggerServerEvent("GUIwins",getLocalPlayer()) end addEvent("GUIwins",true) addEventHandler("GUIwins",root,function(wins) if stats then GUIEditor_Label[10] = guiCreateLabel(55,100,287,17,"" ..wins.. "",false,GUIEditor_Window[1]) end end ) GUIEditor_Label[4] = guiCreateLabel(18,129,38,16,"Points:",false,GUIEditor_Window[1]) if GUIEditor_Label[4] then triggerServerEvent("GUIpoints",getLocalPlayer()) end addEvent("GUIpoints",true) addEventHandler("GUIpoints",root,function(points) if stats then GUIEditor_Label[11] = guiCreateLabel(60,129,287,17,"" ..points.. "",false,GUIEditor_Window[1]) end end ) GUIEditor_Label[5] = guiCreateLabel(17,159,83,16,"Second places:",false,GUIEditor_Window[1]) if GUIEditor_Label[5] then triggerServerEvent("GUIsecond",getLocalPlayer()) end addEvent("GUIsecond",true) addEventHandler("GUIsecond",root,function(second) if stats then GUIEditor_Label[12] = guiCreateLabel(102,159,287,17,"" ..second.. "",false,GUIEditor_Window[1]) end end ) GUIEditor_Label[6] = guiCreateLabel(16,184,73,15,"Third places:",false,GUIEditor_Window[1]) if GUIEditor_Label[6] then triggerServerEvent("GUIthird",getLocalPlayer()) end addEvent("GUIthird",true) addEventHandler("GUIthird",root,function(third) if stats then GUIEditor_Label[13] = guiCreateLabel(90,184,287,17,"" ..third.. "",false,GUIEditor_Window[1]) end end ) GUIEditor_Label[7] = guiCreateLabel(17,213,33,17,"Rank:",false,GUIEditor_Window[1]) if GUIEditor_Label[7] then triggerServerEvent("GUIrank",getLocalPlayer()) end addEvent("GUIrank",true) addEventHandler("GUIrank",root,function(rank) if stats then GUIEditor_Label[14] = guiCreateLabel(51,213,287,17,"" ..rank.. "",false,GUIEditor_Window[1]) end end ) GUIEditor_Button[1] = guiCreateButton(369,259,113,30,"Close (F3)",false,GUIEditor_Window[1]) GUIEditor_Label[8] = guiCreateLabel(384,27,114,18,"Created by |V",false,GUIEditor_Window[1]) GUIEditor_Image[1] = guiCreateStaticImage(14,249,183,37,"images/shruk.png",false,GUIEditor_Window[1]) server.lua addEvent("GUIwins",true) addEventHandler("GUIwins",root,function() wins = getElementData(source,"wins") triggerClientEvent(source,"GUIwins",source,wins) end end) addEvent("GUIpoints,true) addEventHandler("GUIpoints",root,function() points = getElementData(source,"points") triggerClientEvent(source,"GUIpoints",source,points) end end) addEvent("GUIsecond",true) addEventHandler("GUIsecond",root,function() second = getElementData(source,"second") triggerClientEvent(source,"GUIsecond",source,second) end end) addEvent("GUIthird",true) addEventHandler("GUIthird",root,function() third = getElementData(source,"third") triggerClientEvent(source,"GUIthird",source,third) end end) addEvent("GUIrank",true) addEventHandler("GUIrank",root,function() rank = getElementData(source,"rank") triggerClientEvent(source,"GUIrank",source,rank) end end) function addbind(player) unbindKey(player, "F1", "down", toggleManager) bindKey(player, "F1", "down", toggleManager) end i have this warning: sts/server.lua:7: ')' expected (to close '(' at line 3) near 'end'. what can i do for that?
-
hello scripters, im trying to make a gui panel for my stats script. i have a problem now. local playerSerial = getPlayerSerial( thePlayer ) local playerPoint = getElementData(getLocalPlayer(), "points") local playerWins = getElementData(getLocalPlayer(), "wins") local playerSecond = getElementData(getLocalPlayer(), "second") local playerThird = getElementData(getLocalPlayer(), "third") local playerRank = getElementData(getLocalPlayer(), "rank") GUIEditor_Window = {} GUIEditor_Button = {} GUIEditor_Label = {} GUIEditor_Image = {} GUIEditor_Window[1] = guiCreateWindow(355,249,503,303,"FuckN| Destruction Derby Userpanel v1.01",false) GUIEditor_Label[1] = guiCreateLabel(20,31,196,26,"Your Stats:",false,GUIEditor_Window[1]) GUIEditor_Label[2] = guiCreateLabel(20,68,34,16,"Serial:",false,GUIEditor_Window[1]) GUIEditor_Label[3] = guiCreateLabel(19,99,32,17,"Wins:",false,GUIEditor_Window[1]) GUIEditor_Label[4] = guiCreateLabel(18,129,38,16,"Points:",false,GUIEditor_Window[1]) GUIEditor_Label[5] = guiCreateLabel(17,159,83,16,"Second places:",false,GUIEditor_Window[1]) GUIEditor_Label[6] = guiCreateLabel(16,184,73,15,"Third places:",false,GUIEditor_Window[1]) GUIEditor_Label[7] = guiCreateLabel(17,213,33,17,"Rank:",false,GUIEditor_Window[1]) GUIEditor_Button[1] = guiCreateButton(369,259,113,30,"Close (F3)",false,GUIEditor_Window[1]) GUIEditor_Label[8] = guiCreateLabel(384,27,114,18,"Created by FuckN|V",false,GUIEditor_Window[1]) GUIEditor_Image[1] = guiCreateStaticImage(14,249,183,37,"images/shruk.png",false,GUIEditor_Window[1]) GUIEditor_Label[9] = guiCreateLabel(58,68,287,17,"" ..playerSerial.. "",false,GUIEditor_Window[1]) GUIEditor_Label[10] = guiCreateLabel(55,100,287,17,"" ..playerWins.. "",false,GUIEditor_Window[1]) GUIEditor_Label[11] = guiCreateLabel(60,129,287,17,"" ..playerPoints.. "",false,GUIEditor_Window[1]) GUIEditor_Label[12] = guiCreateLabel(102,159,287,17,"" ..playerSecond.. "",false,GUIEditor_Window[1]) GUIEditor_Label[13] = guiCreateLabel(90,184,287,17,"" ..playerThird.. "",false,GUIEditor_Window[1]) GUIEditor_Label[14] = guiCreateLabel(51,213,287,17,"" ..playerRank.. "",false,GUIEditor_Window[1]) how can i take datas from server-side? also how can i add bind for gui and set mouse visible? thanks for now.
-
Read it please. player_Wasted is number and you want get data from number? oh. thanks dude. i am a idiot thank you for helping too
-
different. when i use that local puan = tonumber ( loadPlayerData( player_Wasted, "points" ) ) or 0 it doesnt effect to "points".
-
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. so? can you help me please?
-
in race folder same warning " attemp to perform aritmetic on local 'playerPoints' (a nil value) "
-
function bastardDied( player_Wasted ) outputChatBox ( "I am death", player_wasted, 255, 0, 255, true ) local rank12 = exports.race:getPlayerRank( player_Wasted ) outputChatBox ( rank12, player_wasted, 255, 255, 0, true ) -- maybe this works or not... other it will just a warning. if(rank12 > 0) then outputChatBox ( "I have a rank", player_wasted, 0, 255, 255, true ) end if(rank12 == 2) then local olme = 5 local puan = tonumber ( loadPlayerData( player_Wasted, "points" ) ) savePlayerData( player_Wasted, "points", puan + olme ) 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(rank12 == 3) then local olme = 3 local puan = tonumber ( loadPlayerData( player_Wasted, "points" ) ) savePlayerData( player_Wasted, "points", puan + olme ) 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(rank12 == 4) then local olme = 1 local puan = tonumber ( loadPlayerData( player_Wasted, "points" ) ) savePlayerData( player_Wasted, "points", puan - olme ) outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) elseif(rank12 == 5) then local olme = 1 local puan = tonumber ( loadPlayerData( player_Wasted, "points" ) ) savePlayerData( player_Wasted, "points", puan - olme ) outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) elseif(rank12 == 6) then local olme = 1 local puan = tonumber ( loadPlayerData( player_Wasted, "points" ) ) savePlayerData( player_Wasted, "points", puan - olme ) outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) elseif(rank12 == 7) then local olme = 1 local puan = tonumber ( loadPlayerData( player_Wasted, "points" ) ) savePlayerData( player_Wasted, "points", puan - olme ) outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) elseif(rank12 == then local olme = 1 local puan = tonumber ( loadPlayerData( player_Wasted, "points" ) ) savePlayerData( player_Wasted, "points", puan - olme ) outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) elseif(rank12 == 9) then local olme = 1 local puan = tonumber ( loadPlayerData( player_Wasted, "points" ) ) savePlayerData( player_Wasted, "points", puan - olme ) outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) elseif(rank12 == 10) then local olme = 1 local puan = tonumber ( loadPlayerData( player_Wasted, "points" ) ) savePlayerData( player_Wasted, "points", puan - olme ) outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) elseif(rank12 == 11) then local olme = 1 local puan = tonumber ( loadPlayerData( player_Wasted, "points" ) ) savePlayerData( player_Wasted, "points", puan - olme ) outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) elseif(rank12 == 12) then local olme = 1 local puan = tonumber ( loadPlayerData( player_Wasted, "points" ) ) savePlayerData( player_Wasted, "points", puan - olme ) outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) elseif(rank12 == 13) then local olme = 1 local puan = tonumber ( loadPlayerData( player_Wasted, "points" ) ) savePlayerData( player_Wasted, "points", puan - olme ) outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) elseif(rank12 == 14) then local olme = 1 local puan = tonumber ( loadPlayerData( player_Wasted, "points" ) ) savePlayerData( player_Wasted, "points", puan - olme ) outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) elseif(rank12 == 15) then local olme = 1 local puan = tonumber ( loadPlayerData( player_Wasted, "points" ) ) savePlayerData( player_Wasted, "points", puan - olme ) outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) elseif(rank12 == 16) then local olme = 1 local puan = tonumber ( loadPlayerData( player_Wasted, "points" ) ) savePlayerData( player_Wasted, "points", puan - olme ) outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) elseif(rank12 == 17) then local olme = 1 local puan = tonumber ( loadPlayerData( player_Wasted, "points" ) ) savePlayerData( player_Wasted, "points", puan - olme ) outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) elseif(rank12 == 18) then local olme = 1 local puan = tonumber ( loadPlayerData( player_Wasted, "points" ) ) savePlayerData( player_Wasted, "points", puan - olme ) outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) elseif(rank12 == 19) then local olme = 1 local puan = tonumber ( loadPlayerData( player_Wasted, "points" ) ) savePlayerData( player_Wasted, "points", puan - olme ) outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) elseif(rank12 == 20) then local olme = 1 local puan = tonumber ( loadPlayerData( player_Wasted, "points" ) ) savePlayerData( player_Wasted, "points", puan - olme ) outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) elseif(rank12 == 21) then local olme = 1 local puan = tonumber ( loadPlayerData( player_Wasted, "points" ) ) savePlayerData( player_Wasted, "points", puan - olme ) outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) elseif(rank12 == 22) then local olme = 1 local puan = tonumber ( loadPlayerData( player_Wasted, "points" ) ) savePlayerData( player_Wasted, "points", puan - olme ) outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) elseif(rank12 == 23) then local olme = 1 local puan = tonumber ( loadPlayerData( player_Wasted, "points" ) ) savePlayerData( player_Wasted, "points", puan - olme ) outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) elseif(rank12 == 24) then local olme = 1 local puan = tonumber ( loadPlayerData( player_Wasted, "points" ) ) savePlayerData( player_Wasted, "points", puan - olme ) outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) elseif(rank12 == 25) then local olme = 1 local puan = tonumber ( loadPlayerData( player_Wasted, "points" ) ) savePlayerData( player_Wasted, "points", puan - olme ) outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) elseif(rank12 == 26) then local olme = 1 local puan = tonumber ( loadPlayerData( player_Wasted, "points" ) ) savePlayerData( player_Wasted, "points", puan - olme ) outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) elseif(rank12 == 27) then local olme = 1 local puan = tonumber ( loadPlayerData( player_Wasted, "points" ) ) savePlayerData( player_Wasted, "points", puan - olme ) outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) elseif(rank12 == 28) then local olme = 1 local puan = tonumber ( loadPlayerData( player_Wasted, "points" ) ) savePlayerData( player_Wasted, "points", puan - olme ) outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) elseif(rank12 == 29) then local olme = 1 local puan = tonumber ( loadPlayerData( player_Wasted, "points" ) ) savePlayerData( player_Wasted, "points", puan - olme ) outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) elseif(rank12 == 30) then local olme = 1 local puan = tonumber ( loadPlayerData( player_Wasted, "points" ) ) savePlayerData( player_Wasted, "points", puan - olme ) outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) end end addEventHandler("onPlayerWasted", getRootElement(), bastardDied) with this code i have this error. attemp to perform aritmetic on local 'puan' (a nil value)
-
it must be worked. all is same for the xml database. if you want i can send you all script on pm.
-
thank you so much for answer. but it doesnt effect to "points". what can i do for that?
-
function bastardDied( player_Wasted ) local rank = exports.race:getPlayerRank( player_Wasted ) if(rank == 2) then local pointsToDie = 5 local playerPoints = 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" ) ) 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 == 4) then local pointsToDie = 1 local playerPoints = tonumber ( loadPlayerData( player_Wasted, "points" ) ) savePlayerData( player_Wasted, "points", playerPoints - pointsToDie ) outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) elseif(rank == 5) then local pointsToDie = 1 local playerPoints = tonumber ( loadPlayerData( player_Wasted, "points" ) ) savePlayerData( player_Wasted, "points", playerPoints - pointsToDie ) outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) elseif(rank == 6) then local pointsToDie = 1 local playerPoints = tonumber ( loadPlayerData( player_Wasted, "points" ) ) savePlayerData( player_Wasted, "points", playerPoints - pointsToDie ) outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) elseif(rank == 7) then local pointsToDie = 1 local playerPoints = tonumber ( loadPlayerData( player_Wasted, "points" ) ) savePlayerData( player_Wasted, "points", playerPoints - pointsToDie ) outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) elseif(rank == then local pointsToDie = 1 local playerPoints = tonumber ( loadPlayerData( player_Wasted, "points" ) ) savePlayerData( player_Wasted, "points", playerPoints - pointsToDie ) outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) elseif(rank == 9) then local pointsToDie = 1 local playerPoints = tonumber ( loadPlayerData( player_Wasted, "points" ) ) savePlayerData( player_Wasted, "points", playerPoints - pointsToDie ) outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) elseif(rank == 10) then local pointsToDie = 1 local playerPoints = tonumber ( loadPlayerData( player_Wasted, "points" ) ) savePlayerData( player_Wasted, "points", playerPoints - pointsToDie ) outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) elseif(rank == 11) then local pointsToDie = 1 local playerPoints = tonumber ( loadPlayerData( player_Wasted, "points" ) ) savePlayerData( player_Wasted, "points", playerPoints - pointsToDie ) outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) elseif(rank == 12) then local pointsToDie = 1 local playerPoints = tonumber ( loadPlayerData( player_Wasted, "points" ) ) savePlayerData( player_Wasted, "points", playerPoints - pointsToDie ) outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) elseif(rank == 13) then local pointsToDie = 1 local playerPoints = tonumber ( loadPlayerData( player_Wasted, "points" ) ) savePlayerData( player_Wasted, "points", playerPoints - pointsToDie ) outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) elseif(rank == 14) then local pointsToDie = 1 local playerPoints = tonumber ( loadPlayerData( player_Wasted, "points" ) ) savePlayerData( player_Wasted, "points", playerPoints - pointsToDie ) outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) elseif(rank == 15) then local pointsToDie = 1 local playerPoints = tonumber ( loadPlayerData( player_Wasted, "points" ) ) savePlayerData( player_Wasted, "points", playerPoints - pointsToDie ) outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) elseif(rank == 16) then local pointsToDie = 1 local playerPoints = tonumber ( loadPlayerData( player_Wasted, "points" ) ) savePlayerData( player_Wasted, "points", playerPoints - pointsToDie ) outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) elseif(rank == 17) then local pointsToDie = 1 local playerPoints = tonumber ( loadPlayerData( player_Wasted, "points" ) ) savePlayerData( player_Wasted, "points", playerPoints - pointsToDie ) outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) elseif(rank == 18) then local pointsToDie = 1 local playerPoints = tonumber ( loadPlayerData( player_Wasted, "points" ) ) savePlayerData( player_Wasted, "points", playerPoints - pointsToDie ) outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) elseif(rank == 19) then local pointsToDie = 1 local playerPoints = tonumber ( loadPlayerData( player_Wasted, "points" ) ) savePlayerData( player_Wasted, "points", playerPoints - pointsToDie ) outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) elseif(rank == 20) then local pointsToDie = 1 local playerPoints = tonumber ( loadPlayerData( player_Wasted, "points" ) ) savePlayerData( player_Wasted, "points", playerPoints - pointsToDie ) outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) elseif(rank == 21) then local pointsToDie = 1 local playerPoints = tonumber ( loadPlayerData( player_Wasted, "points" ) ) savePlayerData( player_Wasted, "points", playerPoints - pointsToDie ) outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) elseif(rank == 22) then local pointsToDie = 1 local playerPoints = tonumber ( loadPlayerData( player_Wasted, "points" ) ) savePlayerData( player_Wasted, "points", playerPoints - pointsToDie ) outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) elseif(rank == 23) then local pointsToDie = 1 local playerPoints = tonumber ( loadPlayerData( player_Wasted, "points" ) ) savePlayerData( player_Wasted, "points", playerPoints - pointsToDie ) outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) elseif(rank == 24) then local pointsToDie = 1 local playerPoints = tonumber ( loadPlayerData( player_Wasted, "points" ) ) savePlayerData( player_Wasted, "points", playerPoints - pointsToDie ) outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) elseif(rank == 25) then local pointsToDie = 1 local playerPoints = tonumber ( loadPlayerData( player_Wasted, "points" ) ) savePlayerData( player_Wasted, "points", playerPoints - pointsToDie ) outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) elseif(rank == 26) then local pointsToDie = 1 local playerPoints = tonumber ( loadPlayerData( player_Wasted, "points" ) ) savePlayerData( player_Wasted, "points", playerPoints - pointsToDie ) outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) elseif(rank == 27) then local pointsToDie = 1 local playerPoints = tonumber ( loadPlayerData( player_Wasted, "points" ) ) savePlayerData( player_Wasted, "points", playerPoints - pointsToDie ) outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) elseif(rank == 28) then local pointsToDie = 1 local playerPoints = tonumber ( loadPlayerData( player_Wasted, "points" ) ) savePlayerData( player_Wasted, "points", playerPoints - pointsToDie ) outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) elseif(rank == 29) then local pointsToDie = 1 local playerPoints = tonumber ( loadPlayerData( player_Wasted, "points" ) ) savePlayerData( player_Wasted, "points", playerPoints - pointsToDie ) outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) elseif(rank == 30) then local pointsToDie = 1 local playerPoints = tonumber ( loadPlayerData( player_Wasted, "points" ) ) 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) end end WARNING: Loading script failed: fuck-stats/server.lua:129'<eof>' expected near 'end' i have got this warning. can you help me?
-
thanks again. i got it how works.
-
i dont understand. i am new at lua coding. can you explain me? edit: ıh i got it. thank you so much for helping
-
oh my bad but i have got this problem now. function nitro(source, command) local points = getElementData(source,"points") if points >= 10 then if (isPedInVehicle(source)) then addVehicleUpgrade(getPedOccupiedVehicle(source), 1010) setTimer(outputChatBox,50,1,"#c0c0c0* #abcdef"..getPlayerName (source).." #c0c0c0bought nitro for #abcdef10#c0c0c0 points!",root, 255, 255, 255, true ) local cashToNos = 10 savePlayerData(nitro, "points", points - cashToNos ) else outputChatBox ("#c0c0c0* You must sit in a car to buy nitro it!",source, 255, 255, 255, true ) cancelEvent() end else outputChatBox ("#c0c0c0* You can't buy nitro, you need #abcdef10#c0c0c0 points first!",source, 255, 255, 255, true ) cancelEvent() end end addCommandHandler("nitro", nitro) addCommandHandler("nos", nitro) code works great but it doenst effect to "points". whats wrong?
-
function nitro(source, command) local points = getElementData(source,"points") if points >= 10 then if (isPedInVehicle(source)) then addVehicleUpgrade(getPedOccupiedVehicle(source), 1010) setTimer(outputChatBox,50,1,"#c0c0c0* #abcdef"..getPlayerName (source).." #c0c0c0bought nitro for #abcdef10#c0c0c0 points!",root, 255, 255, 255, true ) savePlayerData( nitro, "points", playerPoints - 10 ) else outputChatBox ("#c0c0c0* You must sit in a car to buy nitro it!",source, 255, 255, 255, true ) cancelEvent() end else outputChatBox ("#c0c0c0* You can't buy nitro, you need #abcdef10#c0c0c0 points first!",source, 255, 255, 255, true ) cancelEvent() end end addCommandHandler("nitro", nos) addCommandHandler("nos", nos) server.lua:17 bad argument @ 'addCommandHandler' [Expected function at argument 2, got nil] server.lua:18 bad argument @ 'addCommandHandler' [Expected function at argument 2, got nil] i have got this error. what is wrong?
-
addEvent("onPlayerWasted") function player_Wasted() for i,v in ipairs">ipairs(getElementsByType('player')) do local rank = exports.race:getPlayerRank(source) if(rank == 2) then local pointsToDie = 5 local playerPoints = 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">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 third place and got #abcdef3 #c0c0c0points!", root, 255, 255, 255, true ) elseif(rank == 4) then local pointsToDie = 1 local playerPoints = tonumber">tonumber ( loadPlayerData( player_Wasted, "points" ) ) savePlayerData( player_Wasted, "points", playerPoints - pointsToDie ) outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) elseif(rank == 5) then local pointsToDie = 1 local playerPoints = tonumber">tonumber ( loadPlayerData( player_Wasted, "points" ) ) savePlayerData( player_Wasted, "points", playerPoints - pointsToDie ) outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) elseif(rank == 6) then local pointsToDie = 1 local playerPoints = tonumber">tonumber ( loadPlayerData( player_Wasted, "points" ) ) savePlayerData( player_Wasted, "points", playerPoints - pointsToDie ) outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) elseif(rank == 7) then local pointsToDie = 1 local playerPoints = tonumber">tonumber ( loadPlayerData( player_Wasted, "points" ) ) savePlayerData( player_Wasted, "points", playerPoints - pointsToDie ) outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) elseif(rank == <!-- s8) --><img src=\"{SMILIES_PATH}/icon_cool.gif\" alt=\"8)\" title=\"Cool\" /><!-- s8) --> then local pointsToDie = 1 local playerPoints = tonumber">tonumber ( loadPlayerData( player_Wasted, "points" ) ) savePlayerData( player_Wasted, "points", playerPoints - pointsToDie ) outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) elseif(rank == 9) then local pointsToDie = 1 local playerPoints = tonumber">tonumber ( loadPlayerData( player_Wasted, "points" ) ) savePlayerData( player_Wasted, "points", playerPoints - pointsToDie ) outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) elseif(rank == 10) then local pointsToDie = 1 local playerPoints = tonumber">tonumber ( loadPlayerData( player_Wasted, "points" ) ) savePlayerData( player_Wasted, "points", playerPoints - pointsToDie ) outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) elseif(rank == 11) then local pointsToDie = 1 local playerPoints = tonumber">tonumber ( loadPlayerData( player_Wasted, "points" ) ) savePlayerData( player_Wasted, "points", playerPoints - pointsToDie ) outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) elseif(rank == 12) then local pointsToDie = 1 local playerPoints = tonumber">tonumber ( loadPlayerData( player_Wasted, "points" ) ) savePlayerData( player_Wasted, "points", playerPoints - pointsToDie ) outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) elseif(rank == 13) then local pointsToDie = 1 local playerPoints = tonumber">tonumber ( loadPlayerData( player_Wasted, "points" ) ) savePlayerData( player_Wasted, "points", playerPoints - pointsToDie ) outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) elseif(rank == 14) then local pointsToDie = 1 local playerPoints = tonumber">tonumber ( loadPlayerData( player_Wasted, "points" ) ) savePlayerData( player_Wasted, "points", playerPoints - pointsToDie ) outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) elseif(rank == 15) then local pointsToDie = 1 local playerPoints = tonumber">tonumber ( loadPlayerData( player_Wasted, "points" ) ) savePlayerData( player_Wasted, "points", playerPoints - pointsToDie ) outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) elseif(rank == 16) then local pointsToDie = 1 local playerPoints = tonumber">tonumber ( loadPlayerData( player_Wasted, "points" ) ) savePlayerData( player_Wasted, "points", playerPoints - pointsToDie ) outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) elseif(rank == 17) then local pointsToDie = 1 local playerPoints = tonumber">tonumber ( loadPlayerData( player_Wasted, "points" ) ) savePlayerData( player_Wasted, "points", playerPoints - pointsToDie ) outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) elseif(rank == 18) then local pointsToDie = 1 local playerPoints = tonumber">tonumber ( loadPlayerData( player_Wasted, "points" ) ) savePlayerData( player_Wasted, "points", playerPoints - pointsToDie ) outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) elseif(rank == 19) then local pointsToDie = 1 local playerPoints = tonumber">tonumber ( loadPlayerData( player_Wasted, "points" ) ) savePlayerData( player_Wasted, "points", playerPoints - pointsToDie ) outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) elseif(rank == 20) then local pointsToDie = 1 local playerPoints = tonumber">tonumber ( loadPlayerData( player_Wasted, "points" ) ) savePlayerData( player_Wasted, "points", playerPoints - pointsToDie ) outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) elseif(rank == 21) then local pointsToDie = 1 local playerPoints = tonumber">tonumber ( loadPlayerData( player_Wasted, "points" ) ) savePlayerData( player_Wasted, "points", playerPoints - pointsToDie ) outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) elseif(rank == 22) then local pointsToDie = 1 local playerPoints = tonumber">tonumber ( loadPlayerData( player_Wasted, "points" ) ) savePlayerData( player_Wasted, "points", playerPoints - pointsToDie ) outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) elseif(rank == 23) then local pointsToDie = 1 local playerPoints = tonumber">tonumber ( loadPlayerData( player_Wasted, "points" ) ) savePlayerData( player_Wasted, "points", playerPoints - pointsToDie ) outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) elseif(rank == 24) then local pointsToDie = 1 local playerPoints = tonumber">tonumber ( loadPlayerData( player_Wasted, "points" ) ) savePlayerData( player_Wasted, "points", playerPoints - pointsToDie ) outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) elseif(rank == 25) then local pointsToDie = 1 local playerPoints = tonumber">tonumber ( loadPlayerData( player_Wasted, "points" ) ) savePlayerData( player_Wasted, "points", playerPoints - pointsToDie ) outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) elseif(rank == 26) then local pointsToDie = 1 local playerPoints = tonumber">tonumber ( loadPlayerData( player_Wasted, "points" ) ) savePlayerData( player_Wasted, "points", playerPoints - pointsToDie ) outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) elseif(rank == 27) then local pointsToDie = 1 local playerPoints = tonumber">tonumber ( loadPlayerData( player_Wasted, "points" ) ) savePlayerData( player_Wasted, "points", playerPoints - pointsToDie ) outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) elseif(rank == 28) then local pointsToDie = 1 local playerPoints = tonumber">tonumber ( loadPlayerData( player_Wasted, "points" ) ) savePlayerData( player_Wasted, "points", playerPoints - pointsToDie ) outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) elseif(rank == 29) then local pointsToDie = 1 local playerPoints = tonumber">tonumber ( loadPlayerData( player_Wasted, "points" ) ) savePlayerData( player_Wasted, "points", playerPoints - pointsToDie ) outputChatBox ( "#c0c0c0* #abcdefYou died and lost #abcdef1 #c0c0c0point!", player_wasted, 255, 255, 255, true ) elseif(rank == 30) then local pointsToDie = 1 local playerPoints = tonumber">tonumber ( loadPlayerData( player_Wasted, "points" ) ) 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(), player_Wasted) end end it isnt running. it give error on /debugscript 3. i dont know mean of this. can you help me please?
-
hmm thank you dude. i love you
-
call(getResourceFromName("scoreboard"), "addScoreboardColumn", "wins") call(getResourceFromName("scoreboard"), "addScoreboardColumn", "points") function loadPlayerData ( player, datatype ) if ( not player or not isElement( player ) ) then return false end local playerIP = getPlayerSerial ( player ) if ( playerIP ) then local root = xmlLoadFile ("users.xml") if ( root ) then local usersNode = xmlFindChild ( root, "user", 0 ) if ( usersNode ) then local playerRootNode = xmlFindChild ( usersNode, "SERIAL_" .. getPlayerSerial(player), 0 ) if not ( playerRootNode == false ) then local playerData = xmlNodeGetAttribute ( playerRootNode, datatype ) if ( playerData ) then xmlUnloadFile ( root ) return playerData else xmlNodeSetAttribute ( playerRootNode, datatype, 0 ) xmlSaveFile ( root ) xmlUnloadFile ( root ) return 0 end else local playerRootNode = xmlCreateChild ( usersNode, "SERIAL_" .. getPlayerSerial(player) ) xmlNodeSetAttribute ( playerRootNode, datatype, 0 ) xmlSaveFile ( root ) xmlUnloadFile ( root ) return 0 end end end end end function savePlayerData ( player, datatype, newvalue ) if ( not player or not isElement( player ) ) then return false end local playerIP = getPlayerSerial (player) if ( playerIP ) then local root = xmlLoadFile ("users.xml") if ( root ) then local usersNode = xmlFindChild ( root, "user", 0 ) if ( usersNode ) then local playerRootNode = xmlFindChild ( usersNode, "SERIAL_" .. getPlayerSerial(player), 0 ) if not ( playerRootNode == false ) then local newNodeValue = xmlNodeSetAttribute ( playerRootNode, datatype, newvalue ) xmlSaveFile ( root ) xmlUnloadFile ( root ) return newNodeValue else local playerRootNode = xmlCreateChild ( usersNode, "SERIAL_" .. getPlayerSerial(player) ) local newNodeValue = xmlNodeSetAttribute ( playerRootNode, datatype, newvalue ) xmlSaveFile ( root ) xmlUnloadFile ( root ) return newNodeValue end end end end end function exporter() local playerCash = tonumber( loadPlayerData ( source, "wins" ) ) setElementData ( source, "wins", playerCash ) local playerPoint = tonumber( loadPlayerData ( source, "points" ) ) setElementData ( source, "points", playerPoint ) end addEventHandler ( "onPlayerJoin", getRootElement(), exporter) addEventHandler ( "onPlayerWasted", getRootElement(), exporter) addEventHandler ( "onPlayerChat", getRootElement(), exporter) addEventHandler ( "onNotifyPlayerReady", getRootElement(), exporter) addEventHandler ( "onPlayerPickUpRacePickup", getRootElement(), exporter) ----------------------------------------------------------------- addEvent("onPlayerDestructionDerbyWin",true) addEventHandler("onPlayerDestructionDerbyWin",getRootElement(), function (winner) if ( getPlayerCount() >= 2 )then local cashToWin = 1 local playerCash = tonumber( loadPlayerData( winner, "wins" ) ) savePlayerData( winner, "wins", playerCash + cashToWin ) local playerCash = loadPlayerData( winner, "wins" ) outputChatBox ( "#c0c0c0* #abcdef" .. getPlayerName(winner) .." #c0c0c0has win this round.", root, 255, 255, 255, true ) else outputChatBox( "#c0c0c0* Not enough players to earn money - #ABCDEF2 players #c0c0c0required.", winner, 255, 255, 255, true ) totalMoneyEarnedAdd ( winner, cashToWin ) scoreboardRefresh ( winner ) refreshStats ( winner ) progressBarUpdate ( winner ) totalMoneyAchievements ( winner ) end end ) ----------------------------------------------------------------- addEvent("onPlayerDestructionDerbyWin1",true) addEventHandler("onPlayerDestructionDerbyWin1",getRootElement(), function (winner1) if ( getPlayerCount() >= 2 )then local cashToWin1 = 3 local playerPoint = tonumber loadPlayerData( winner1, "points" ) savePlayerData( winner1, "points", playerPoint + cashToWin1 ) local playerPoint = loadPlayerData( winner1, "points" ) --outputChatBox ( "#c0c0c0* #abcdef" .. getPlayerName(winner1) .." #c0c0c0has win this round.", root, 255, 255, 255, true ) else --outputChatBox( "#c0c0c0* Not enough players to earn money - #ABCDEF2 players #c0c0c0required.", winner1, 255, 255, 255, true ) totalMoneyEarnedAdd ( winner1, cashToWin1 ) scoreboardRefresh ( winner1 ) refreshStats ( winner1 ) progressBarUpdate ( winner1 ) totalMoneyAchievements ( winner1 ) end end ) i have another problem now. im trying to make point system. but point dont effect. can you help me please?
-
thank you man. you save my life.
-
not helped. when i use debugscript 3 it shows.
-
hello it isnt running. i took some codes from nextreme's userpanel. can you help me please? serverside function loadPlayerData (player,datatype) local playerIP = getPlayerSerial (player) if (playerIP) then local root = xmlLoadFile ("users.xml") if (root) then local usersNode = xmlFindChild (root,"user",0) if (usersNode) then local playerRootNode = xmlFindChild (usersNode,"SERIAL_" .. getPlayerSerial(player),0) if not (playerRootNode == false) then local playerData = xmlNodeGetAttribute (playerRootNode,datatype) if (playerData) then xmlUnloadFile (root) return playerData else xmlNodeSetAttribute (playerRootNode,datatype,0) xmlSaveFile (root) xmlUnloadFile (root) return 0 end else local playerRootNode = xmlCreateChild (usersNode,"SERIAL_" .. getPlayerSerial(player)) xmlNodeSetAttribute (playerRootNode,datatype,0) xmlSaveFile (root) xmlUnloadFile (root) return 0 end end end end end function savePlayerData (player,datatype,newvalue) local playerIP = getPlayerSerial (player) if (playerIP) then local root = xmlLoadFile ("users.xml") if (root) then local usersNode = xmlFindChild (root,"user",0) if (usersNode) then local playerRootNode = xmlFindChild (usersNode,"SERIAL_" .. getPlayerSerial(player),0) if not (playerRootNode == false) then local newNodeValue = xmlNodeSetAttribute (playerRootNode,datatype,newvalue) xmlSaveFile (root) xmlUnloadFile (root) return newNodeValue else local playerRootNode = xmlCreateChild (usersNode,"SERIAL_" .. getPlayerSerial(player)) local newNodeValue = xmlNodeSetAttribute (playerRootNode,datatype,newvalue) xmlSaveFile (root) xmlUnloadFile (root) return newNodeValue end end end end end function exporter(thePlayer) local playerCash = tonumber">tonumber(loadPlayerData(thePlayer,"cash")) setElementData(thePlayer,"Cash",playerCash) end addEventHandler ( "onPlayerJoin", getRootElement(), exporter) addEventHandler ( "onPlayerWasted", getRootElement(), exporter) addEventHandler ( "onPlayerChat", getRootElement(), exporter) addEventHandler ( "onNotifyPlayerReady", getRootElement(), exporter) addEventHandler ( "onPlayerPickUpRacePickup", getRootElement(), exporter) ---------------------------------------------------- addEvent("onPlayerDestructionDerbyWin",true) addEventHandler("onPlayerDestructionDerbyWin",getRootElement(), function (winner) if getPlayerCount() >= 2 then local cashToWin = 1 local playerCash = loadPlayerData(winner,"cash") savePlayerData(winner,"cash",playerCash +cashToWin) local playerCash = loadPlayerData(winner,"cash") outputChatBox ("#c0c0c0* #abcdef" .. getPlayerName(winner) .." #c0c0c0has win this round.",getRootElement(),255,255,255,true) return else outputChatBox("#c0c0c0* Not enough players to earn money - #ABCDEF2 players #c0c0c0required.",winner,255,255,255,true) end local thePlayer = winner local newAmount = cashToWin totalMoneyEarnedAdd(thePlayer,cashToWin) scoreboardRefresh(thePlayer) refreshStats(thePlayer) progressBarUpdate(thePlayer) totalMoneyAchievements(thePlayer) end) function checkWinAndIfWinGiveWinCash () local rank = getAliveCount() local allAlivePlayers = getAlivePlayers() local player = allAlivePlayers[1] local playerCount = getPlayerCount() local cashToWin = 1 local money = loadPlayerData(player,"cash") if (rank == 1) then savePlayerData(player,"cash",money + cashToWin) outputChatBox ("#c0c0c0* #abcdef"..getPlayerName(player).." #c0c0c0wins this round.",getRootElement(),255,0,0,true) end local player = thePlayer scoreboardRefresh(thePlayer) refreshStats(thePlayer) progressBarUpdate(thePlayer) totalMoneyAchievements(thePlayer) end addEventHandler ("onPlayerWasted",getRootElement(),checkWinAndIfWinGiveWinCash) --------------------------------------------------- call(getResourceFromName("scoreboard"), "addScoreboardColumn", "cash") --------------------------------------------------- addCommandHandler("spd", function(player,command,toplayername,datatype,amount) if hasObjectPermissionTo ( player, "function.kickPlayer", false ) then if (toplayername) and (datatype) and (amount) then if (findPlayerByName (toplayername)) then toplayer = findPlayerByName (toplayername) savePlayerData(toplayer,datatype,amount) outputChatBox ("setPlayerData: " .. getPlayerName(toplayer) .. " | Player's " .. datatype .. " has been set to: " .. amount, player,255,0,0,true) --outputChatBox ("" .. getPlayerName (player) .. " has set your " .. datatype .." to: " .. amount, toplayer,255,0,0,true) local playerCash = loadPlayerData(toplayer,"cash") local thePlayer = toplayer scoreboardRefresh(thePlayer) refreshStats(thePlayer) progressBarUpdate(thePlayer) end else outputChatBox ("ERROR! Syntax: /spd [playername] [datatype] [new_amount]",player,255,255,255,true) end else end end) meta.xml "V" type">type="script" version="3.0.0" /> users.xml