orcun99

pickup , colshapehit , onplayerwasted

Recommended Posts

server side:

   lvcol = createColCircle (  1796.6412353516,1740.2864990234, 1250 ) --LAS VENTURAS COOLSAPEHİT
 
 

function playerJustGotDied(ammo, attacker, weapon, bodypart)
outputChatBox("öldün")
 x, y, z = getElementPosition ( source ) 
  local money = createPickup ( x, y, z, 3, 1212 )
  
end
addEventHandler("onPlayerWasted", getRootElement(), playerJustGotDied);

function pickupUse ( player )
givePlayerMoney ( player, 10000 )
end
addEventHandler ( "onPickupUse", money, pickupUse )
  
  
  
  function giris( player )
       outputChatBox("You will cant use pvp command in Las Venturas",player)
end 
addEventHandler( "onColShapeHit", lvcol, giris ) 

if the player dies in lasventuras, I want the money pickup out where he died.

but if the player not in  dies in lasventuras then there is no pickup out when he died

Edited by orcun99

Share this post


Link to post

Use getZoneName

check for zone name with citiesonly parameter im your playerJustGotDued function

Share this post


Link to post

I don't know how to use getzonename can u edit my code please ? please don't send wiki links :D

Share this post


Link to post
function playerJustGotDied()
	local x, y, z = getElementPosition ( source)
	if (getZoneName (x, y, z, true) == "Las Venturas") then
		local money = createPickup(x, y, z, 3, 1212)
		outputChatBox("öldün")
	end
end
addEventHandler("onPlayerWasted", getRootElement(), playerJustGotDied);

I did not test

  • Thanks 1

Share this post


Link to post
13 hours ago, Tommy. said:

function playerJustGotDied()
	local x, y, z = getElementPosition ( source)
	if (getZoneName (x, y, z, true) == "Las Venturas") then
		local money = createPickup(x, y, z, 3, 1212)
		outputChatBox("öldün")
	end
end
addEventHandler("onPlayerWasted", getRootElement(), playerJustGotDied);

I did not test

works thank u but one more think I need if player onpickup then giveplayer money +1000

Share this post


Link to post

Add this

function pickupUse ( player )
 if getElementModel(source) == 1212 then
		givePlayerMoney ( player, 10000 )
	end
end
addEventHandler ( "onPickupUse", resourceRoot, pickupUse )

 

Edited by CodyJ(L)

Share this post


Link to post

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.