Jump to content

Wanted event


Estevam2d

Recommended Posts

Posted

The player does not get the team star, why?

addEvent("wanted",true)  
addEventHandler("wanted",root,  
function() 
if weapon == 43 and getElementType(source)=="player" then  
if getPlayerTeam(source) == getTeamFromName("Bandido") then 
if setPlayerWantedLevel(source, 1) then 
end 
end 
end 
end  
) 

Posted
  
addEvent("wanted",true) 
addEventHandler("wanted",root, 
    function(weapon) 
        if weapon == 43 and getElementType(source)=="player" then 
            if getPlayerTeam(source) == getTeamFromName("Bandido") then 
                setPlayerWantedLevel(source, 1) 
                end 
            end 
        end 
    end 
) 
  

not sure.

Posted

not worked

I took a photo of the criminal and he does not get star

I took a final, you put one more.

Client:

function onClientPlayerWeaponFireFunc(weapon, ammo, ammoInClip, hitX, hitY, hitZ, hitElement ) 
if getPlayerTeam(hitElement) == getTeamFromName("Bandido") then 
    if weapon == 43 and getElementType(hitElement)=="player" then  
         triggerServerEvent ( "wanted", localPlayer ) 
         end 
    end 
end 
addEventHandler ( "onClientPlayerWeaponFire", getLocalPlayer(), onClientPlayerWeaponFireFunc ) 
  

Server:

addEvent("wanted",true) 
addEventHandler("wanted",root, 
    function(weapon) 
        if weapon == 43 and getElementType(source)=="player" then 
            if getPlayerTeam(source) == getTeamFromName("Bandido") then 
                setPlayerWantedLevel(source, 1) 
            end 
        end 
    end 
) 

Posted
replace source in serverside to client

Heh, don't really need to replace 'source' to 'client'

He can simply use this:

triggerServerEvent ( "wanted", localPlayer, weapon ) 

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