Jump to content

Problem with script.


Rat32

Recommended Posts

Hello. I have a problem. This script give me a weapon, ok - but he doesn't check a money, please help.

CLIENT:

function glock19a() 
triggerServerEvent("glock19e", resourceRoot) 
end 
addEventHandler("onClientGUIClick", p2, glock19a, false) 

SERVER:

addEvent("glock19e", true) 
  
function glock19() 
outputChatBox(money) 
local money = getPlayerMoney(client) 
if money <= 2 then 
    giveWeapon( client, 22, 1, true) 
outputChatBox(money) 
else 
outputChatBox(money) 
   end 
end 
addEventHandler("glock19e", getRootElement(), glock19) 

:fadein:

Link to comment
LINE NUMBER ON/OFF | EXPAND/CONTRACT | SELECT ALL 
  
addEvent("glock19e", true)function glock19()outputChatBox(money)local money = getPlayerMoney(client)if money >=2 then    giveWeapon( client, 22, 1, true)outputChatBox(money)elseoutputChatBox(money)   endendaddEventHandler("glock19e", getRootElement(), glock19) 
  
  

Link to comment
addEvent("glock19e", true) 
function glock19() 
  outputChatBox(money) 
  local money = getPlayerMoney(client) 
  if money >=2 then 
    giveWeapon( client, 22, 1, true) 
    outputChatBox(money) 
  else 
    outputChatBox(money) 
  end 
end 
addEventHandler("glock19e", getRootElement(), glock19) 

Ps. Use proper thread title next time.

Link to comment

Thanks :). I have next problem!

function wejscie(client, thePlayer)

local playerTeam = getPlayerTeam(thePlayer)

local r,g,b = getTeamColor(playerTeam)

triggerClientEvent(root, "nwejscie", client)

if (getElementType(thePlayer) == "player") then

setRadarAreaFlashing ( area, true )

timer = setTimer(function(thePlayer) setRadarAreaColor ( area, r, g, b, 175 ) end, 15000, 1)

end

end

addEventHandler("onColShapeHit", areacol, wejscie)

This code triggered to all players, but i i want trigger to source. How?

Link to comment
area = createRadarArea ( 2150.32666, -1393.43091, 45.61223, -40, 0, 0, 0, 175 ) 
areacol = createColRectangle (2177.8818, -1391.3579, 73.828125, 84.75, 114.5, 2) 
area2 = createRadarArea ( 2058.73267, -1211.01526, 23.98452, -40, 0, 0, 0, 175) 
area2col = createColRectangle (2082.4915, -1206.2887, 86.5, 95, 114.5, 2) 
  
setRadarAreaSize ( area, 100, 100 ) 
setRadarAreaSize ( area2, 100, 100 ) 
  
function wejscie(client, thePlayer) 
local playerTeam = getPlayerTeam(thePlayer) 
local r,g,b = getTeamColor(playerTeam) 
triggerClientEvent(thePlayer, "nwejscie", thePlayer) 
        if (getElementType(thePlayer) == "player") then 
                setRadarAreaFlashing ( area, true ) 
timer = setTimer(function(thePlayer) setRadarAreaColor ( area, r, g, b, 175 ) end, 15000, 1) 
   end 
end 
addEventHandler("onColShapeHit", areacol, wejscie) 
  
function wyjscie(thePlayer) 
        if (getElementType(thePlayer) == "player") then 
                setRadarAreaFlashing ( area, false ) 
killTimer (timer) 
   end 
end 
addEventHandler("onColShapeLeave", areacol, wyjscie) 

Link to comment

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