Jump to content

What is bad ?


iFoReX

Recommended Posts

Posted

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 
  

elMota/elFoReX De Vuelta En MTA *---------*

Cuenta De Youtube En La Que Subo Tutoriales Acerca De MTA :3

https://www.youtube.com/user/KillersGPs

430x73_FFFFFF_FF9900_000000_000000.png
Posted
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) 

CiTLh.png
Posted
appear rango : -, Zombie Kills : -

how you are call function lol ?

or it call his self? :roll:

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 
  

CiTLh.png
Posted
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) 

CiTLh.png
Posted
mmm I need trigger it ?

it won't trigger itself, you need to use event or whatever to trigger the function.

CiTLh.png
Posted
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) 
  

?

elMota/elFoReX De Vuelta En MTA *---------*

Cuenta De Youtube En La Que Subo Tutoriales Acerca De MTA :3

https://www.youtube.com/user/KillersGPs

430x73_FFFFFF_FF9900_000000_000000.png
Posted

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

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

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) 
  

?

elMota/elFoReX De Vuelta En MTA *---------*

Cuenta De Youtube En La Que Subo Tutoriales Acerca De MTA :3

https://www.youtube.com/user/KillersGPs

430x73_FFFFFF_FF9900_000000_000000.png
Posted
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.

CiTLh.png
Posted

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) 

elMota/elFoReX De Vuelta En MTA *---------*

Cuenta De Youtube En La Que Subo Tutoriales Acerca De MTA :3

https://www.youtube.com/user/KillersGPs

430x73_FFFFFF_FF9900_000000_000000.png
Posted
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) 

CiTLh.png
Posted
tapl when a player kill to zombie set to me ur rank and ur zombie kills :/

show your all code

with server/client

357ac0078264.jpg

- Working on [php/HTML/Mysql/Lua/Java Scripts/Web Design/3D Modeling]

Posted

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) 

elMota/elFoReX De Vuelta En MTA *---------*

Cuenta De Youtube En La Que Subo Tutoriales Acerca De MTA :3

https://www.youtube.com/user/KillersGPs

430x73_FFFFFF_FF9900_000000_000000.png

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