Spanish4Life Posted November 7, 2011 Posted November 7, 2011 (text-removed; later releasing) Hi, i've do a little script to when someone's killed, a random message appears. But that don't work:ç --[[ ]]-- function randomMessageKill(killer, killerWeapon, bodypart) local player = getLocalPlayer() local R_N = math.random(7) -- we put 7 possibilities of message if R_N == 1 then --we start outputChatBox("n") elseif R_N == 2 then outputChatBox("n") elseif R_N == 3 then outputChatBox("n") elseif R_N == 4 then outputChatBox("n") elseif R_N == 5 then outputChatBox("n") elseif R_N == 6 then outputChatBox("n") elseif R_N == 7 then call(getResourceFromName("msgbox"), "guiShowMessageBox", "n", n, "n") end end addEventHandler("onPlayerWasted", getRootElement(), randomMessageKill) Visit my web pl0x Thanks to all 200 visitors! Please, help me with the web using the contact section VOTE MTA FOR Mod Of The Year Awards 2011!
Chlorek Posted November 7, 2011 Posted November 7, 2011 But can you say what doesn't work? Outputting messages or what? For first look it looks ok. #Edit I am not sure but it should be math.random(1,7)
Spanish4Life Posted November 7, 2011 Author Posted November 7, 2011 It won't output nothing. I'll gonna test it now; howewer run math.random(7) works Visit my web pl0x Thanks to all 200 visitors! Please, help me with the web using the contact section VOTE MTA FOR Mod Of The Year Awards 2011!
Castillo Posted November 7, 2011 Posted November 7, 2011 Must be because getLocalPlayer() is only CLIENT SIDE and onPlayerWasted is a server side event. Oh and btw, the first argument of onPlayerWasted is the totalAmmo, the second is the killer. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Chlorek Posted November 7, 2011 Posted November 7, 2011 Must be because getLocalPlayer() is only CLIENT SIDE and onPlayerWasted is a server side event. Yea, good job solidsnake Always you are right. Well you have to do that server sided and don't use getLocalPlayer() func.
Spanish4Life Posted November 13, 2011 Author Posted November 13, 2011 (edited) Must be because getLocalPlayer() is only CLIENT SIDE and onPlayerWasted is a server side event. Yea, good job solidsnake Always you are right. Well you have to do that server sided and don't use getLocalPlayer() func. Haha, no: i only needed onClientPlayerWasted. I have strange behaviour, howewer: When I type kill, shows "63" from killer and "2089943303" for weapon. Also, when i drowned i got "53" from killer, why this strange behaviour? Edited November 13, 2011 by Guest Visit my web pl0x Thanks to all 200 visitors! Please, help me with the web using the contact section VOTE MTA FOR Mod Of The Year Awards 2011!
CapY Posted November 13, 2011 Posted November 13, 2011 Must be because getLocalPlayer() is only CLIENT SIDE and onPlayerWasted is a server side event. Yea, good job solidsnake Always you are right. Well you have to do that server sided and don't use getLocalPlayer() func. or triggerServerEvent, right? triggerClientEvent*
Spanish4Life Posted November 13, 2011 Author Posted November 13, 2011 Re-Check avobe post, please. Visit my web pl0x Thanks to all 200 visitors! Please, help me with the web using the contact section VOTE MTA FOR Mod Of The Year Awards 2011!
Spanish4Life Posted November 13, 2011 Author Posted November 13, 2011 Must be because getLocalPlayer() is only CLIENT SIDE and onPlayerWasted is a server side event. Yea, good job solidsnake Always you are right. Well you have to do that server sided and don't use getLocalPlayer() func. Haha, no: i only needed onClientPlayerWasted. I have strange behaviour, howewer: When I type kill, shows "63" from killer and "2089943303" for weapon. Also, when i drowned i got "53" from killer, why this strange behaviour? Then use onClientPlayerWasted -.- Visit my web pl0x Thanks to all 200 visitors! Please, help me with the web using the contact section VOTE MTA FOR Mod Of The Year Awards 2011!
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