iFoReX Posted July 18, 2012 Share Posted July 18, 2012 0 problem in debugscript 3, and appear : Rango : nil, Zombie Kills : nil cl-side function hideIt(zKills,Rank) local x,y,z = getElementPosition(getLocalPlayer()) local city = getZoneName(x,y,z,true) dxDrawText("Ciudad : "..city,0.0,420.0,171.0,449.0,tocolor(255,255,255,255),0.5,"bankgothic","left","top",false,false,false) dxDrawText("Vida : "..getElementHealth(getLocalPlayer()),595.0,548.0,642.0,566.0,tocolor(255,255,255,255),0.5,"bankgothic","left","top",false,false,false) dxDrawText("Rango : "..tostring(Rank),536.0,499.0,656.0,516.0,tocolor(255,255,255,255),0.5,"bankgothic","left","top",false,false,false) dxDrawText("Zombie Kills :"..tostring(zKills),537.0,517.0,657.0,534.0,tocolor(255,255,255,255),0.5,"bankgothic","left","top",false,false,false) end addEventHandler("onClientRender",root,hideIt) addEvent("lolEvent",true) addEventHandler("lolEvent",root,hideIt) sv-side function lol(thePlayer) local account = getPlayerAccount(thePlayer) local zKills = getAccountData(account,"Zombie kills") local Rank = getAccountData(account,"Rango") triggerClientEvent("lolEvent",zKills,Rank) end Link to comment
TAPL Posted July 18, 2012 Share Posted July 18, 2012 zKills = "-" Rank = "-" function hideIt(Kills,Ranks) zKills = Kills Rank = Ranks end addEvent("lolEvent",true) addEventHandler("lolEvent",root,hideIt) function draw() local x,y,z = getElementPosition(getLocalPlayer()) local city = getZoneName(x,y,z,true) dxDrawText("Ciudad : "..city,0.0,420.0,171.0,449.0,tocolor(255,255,255,255),0.5,"bankgothic","left","top",false,false,false) dxDrawText("Vida : "..getElementHealth(getLocalPlayer()),595.0,548.0,642.0,566.0,tocolor(255,255,255,255),0.5,"bankgothic","left","top",false,false,false) dxDrawText("Rango : "..tostring(Rank),536.0,499.0,656.0,516.0,tocolor(255,255,255,255),0.5,"bankgothic","left","top",false,false,false) dxDrawText("Zombie Kills :"..tostring(zKills),537.0,517.0,657.0,534.0,tocolor(255,255,255,255),0.5,"bankgothic","left","top",false,false,false) end addEventHandler("onClientRender",root,draw) Link to comment
iFoReX Posted July 18, 2012 Author Share Posted July 18, 2012 appear rango : -, Zombie Kills : - Link to comment
TAPL Posted July 18, 2012 Share Posted July 18, 2012 appear rango : -, Zombie Kills : - how you are call function lol ? or it call his self? also you trigger for who? function lol(thePlayer) local account = getPlayerAccount(thePlayer) local zKills = getAccountData(account,"Zombie kills") local Rank = getAccountData(account,"Rango") triggerClientEvent(thePlayer,"lolEvent",thePlayer,zKills,Rank) end Link to comment
iFoReX Posted July 18, 2012 Author Share Posted July 18, 2012 I triggered for send accounts data, doesnt work TAPL : Rango : -, Zombie Kills : - Link to comment
TAPL Posted July 18, 2012 Share Posted July 18, 2012 I triggered for send accounts data, doesnt work TAPL : Rango : -, Zombie Kills : - doesn't work? did you try with last code i post? this triggerClientEvent("lolEvent",zKills,Rank) should be triggerClientEvent(thePlayer,"lolEvent",thePlayer,zKills,Rank) Link to comment
iFoReX Posted July 18, 2012 Author Share Posted July 18, 2012 Yeh I copied ur last post, doesnt work TAPL Link to comment
TAPL Posted July 18, 2012 Share Posted July 18, 2012 Yeh I copied ur last post, doesnt work TAPL ok, how is function lol get triggered/called? Link to comment
iFoReX Posted July 18, 2012 Author Share Posted July 18, 2012 mmm I need trigger it ? Link to comment
TAPL Posted July 18, 2012 Share Posted July 18, 2012 mmm I need trigger it ? it won't trigger itself, you need to use event or whatever to trigger the function. Link to comment
iFoReX Posted July 18, 2012 Author Share Posted July 18, 2012 function lol(thePlayer) local account = getPlayerAccount(thePlayer) local zKills = getAccountData(account,"Zombie kills") local Rank = getAccountData(account,"Rango") triggerClientEvent(thePlayer,"lolEvent",thePlayer,zKills,Rank) end addEventHandler("onResourceStart",resourceRoot,lol) ? Link to comment
Castillo Posted July 18, 2012 Share Posted July 18, 2012 @ElMota: When will you read fully about how event system and events work? 'onResourceStart' has no player argument, as is a resource what starts, not a player. I've explained you this many times, I don't know why you still do these mistakes. Link to comment
iFoReX Posted July 18, 2012 Author Share Posted July 18, 2012 Ok, function lol(thePlayer) local account = getPlayerAccount(thePlayer) local zKills = getAccountData(account,"Zombie kills") local Rank = getAccountData(account,"Rango") setElementData(account,"zombieK",zKills) setElementData(account,"Rango",zKills) end addEventHandler("onPlayerJoin",root,lol) ? Link to comment
TAPL Posted July 18, 2012 Share Posted July 18, 2012 when the player join he aren't logged. and still line 2 wrong you should use source. Link to comment
TAPL Posted July 18, 2012 Share Posted July 18, 2012 onPlayerLogin Event ? well, using onPlayerLogin will make for you problem the problem Rango and Zombie Kills won't be updated. try to use event when you kill zombie and event onPlayerLogin, it's will be better. Link to comment
iFoReX Posted July 18, 2012 Author Share Posted July 18, 2012 mmm if I try with timer ? bad argument lines : 2,3,4,5,6 function lol() local account = getPlayerAccount(source) local zKills = getAccountData(account,"Zombie kills") local Rank = getAccountData(account,"Rango") setElementData(account,"zombieK",zKills) setElementData(account,"Rango",zKills) end setTimer(lol,1000,0) Link to comment
TAPL Posted July 18, 2012 Share Posted July 18, 2012 function onZombieWasted(_,killer) if (killer) then if (getElementType(killer) == "player") and (getElementType(source) == "ped") then if (getElementData(source, "zombie") == true) then local account = getPlayerAccount(killer) if account and not isGuestAccount(account) then local zKills = getAccountData(account,"Zombie kills") local Rank = getAccountData(account,"Rango") setElementData(killer,"zombieK",zKills) setElementData(killer,"Rango",Rank) end end end end end addEventHandler("onPedWasted", root, onZombieWasted) Link to comment
TAPL Posted July 18, 2012 Share Posted July 18, 2012 Doesnt work TAPL show your client. Link to comment
iFoReX Posted July 18, 2012 Author Share Posted July 18, 2012 now Work I put a triggerClientEvent, thank you c: u are the better Link to comment
iFoReX Posted July 18, 2012 Author Share Posted July 18, 2012 tapl when a player kill to zombie set to me ur rank and ur zombie kills Link to comment
TwiX! Posted July 18, 2012 Share Posted July 18, 2012 tapl when a player kill to zombie set to me ur rank and ur zombie kills show your all code with server/client Link to comment
iFoReX Posted July 18, 2012 Author Share Posted July 18, 2012 client-side zKills = "-" Rank = "-" function hideIt(Kills,Ranks) zKills = Kills Rank = Ranks end addEvent("lolEvent",true) addEventHandler("lolEvent",root,hideIt) function draw() local x,y,z = getElementPosition(getLocalPlayer()) local city = getZoneName(x,y,z,true) dxDrawText("Ciudad : "..city,0.0,420.0,171.0,449.0,tocolor(255,255,255,255),0.5,"bankgothic","left","top",false,false,false) dxDrawText("Vida : "..getElementHealth(getLocalPlayer()),595.0,548.0,642.0,566.0,tocolor(255,255,255,255),0.5,"bankgothic","left","top",false,false,false) dxDrawText("Rango : "..tostring(Rank),536.0,499.0,656.0,516.0,tocolor(255,255,255,255),0.5,"bankgothic","left","top",false,false,false) dxDrawText("Zombie Kills :"..tostring(zKills),537.0,517.0,657.0,534.0,tocolor(255,255,255,255),0.5,"bankgothic","left","top",false,false,false) end addEventHandler("onClientRender",root,draw) sv.side function onZombieWasted(_,killer) if (killer) then if (getElementType(killer) == "player") and (getElementType(source) == "ped") then if (getElementData(source, "zombie") == true) then local account = getPlayerAccount(killer) if account and not isGuestAccount(account) then local Kills = getAccountData(account,"Zombie kills") local Ranks = getAccountData(account,"Rango") triggerClientEvent("lolEvent",killer,Kills,Ranks) end end end end end addEventHandler("onPedWasted", root, onZombieWasted) Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now