Jump to content

Some help


Wei

Recommended Posts

Hi. How can I add here when player repair car he will get 1000$

CODE:

function onClientPlayerWeaponFireFunc(weapon, ammo, ammoInClip, hitX, hitY, hitZ, hitElement ) 
    if (weapon == 41 and hitElement and getElementType(hitElement)=="vehicle") then  
    if getElementHealth(hitElement) >= 1000 then return end 
          setElementHealth(hitElement, getElementHealth(hitElement)+100) 
    end 
end 
addEventHandler ( "onClientPlayerWeaponFire", getLocalPlayer(), onClientPlayerWeaponFireFunc ) 

Link to comment
Hi. How can I add here when player repair car he will get 1000$

CODE:

function onClientPlayerWeaponFireFunc(weapon, ammo, ammoInClip, hitX, hitY, hitZ, hitElement ) 
    if (weapon == 41 and hitElement and getElementType(hitElement)=="vehicle") then  
    if getElementHealth(hitElement) >= 1000 then return end 
          setElementHealth(hitElement, getElementHealth(hitElement)+100) 
    end 
end 
addEventHandler ( "onClientPlayerWeaponFire", getLocalPlayer(), onClientPlayerWeaponFireFunc ) 

givePlayerMoney 

Link to comment
Hi. How can I add here when player repair car he will get 1000$

CODE:

function onClientPlayerWeaponFireFunc(weapon, ammo, ammoInClip, hitX, hitY, hitZ, hitElement ) 
    if (weapon == 41 and hitElement and getElementType(hitElement)=="vehicle") then  
    if getElementHealth(hitElement) >= 1000 then return end 
          setElementHealth(hitElement, getElementHealth(hitElement)+100) 
    end 
end 
addEventHandler ( "onClientPlayerWeaponFire", getLocalPlayer(), onClientPlayerWeaponFireFunc ) 

givePlayerMoney 

You've helped me a lot!

Link to comment

Doesn't work.

Server:

function givemoney(thePlayer) 
    givePlayerMoney( thePlayer, 1000 ) 
end 
addEvent( "givemoney", true ) 
addEventHandler( "givemoney", thePlayer, givemoney ) 

Client

function onClientPlayerWeaponFireFunc(weapon, ammo, ammoInClip, hitX, hitY, hitZ, hitElement) 
    if (weapon == 41 and hitElement and getElementType(hitElement)=="vehicle") then  
    if getElementHealth(hitElement) >= 1000 then return end 
          setElementHealth(hitElement, getElementHealth(hitElement)+100) 
          triggerServerEvent ( "givemoney", getLocalPlayer())  
    end 
end 
addEventHandler ( "onClientPlayerWeaponFire", getLocalPlayer(), onClientPlayerWeaponFireFunc ) 

Link to comment
addEventHandler ( "onClientPlayerWeaponFire", localPlayer,function(weapon, ammo, ammoInClip, hitX, hitY, hitZ, hitElement) 
    if (weapon == 41 and hitElement and getElementType(hitElement)=="vehicle") then 
    if getElementHealth(hitElement) >= 1000 then return end 
          setElementHealth(hitElement, getElementHealth(hitElement)+100) 
          fixVehicle(hitElement) 
          triggerServerEvent ( "givemoney", getLocalPlayer()) 
    end 
end) 

Link to comment

Thanks. Solved that.

I didn't want to open new post so i'm asking here.

Why it doesn't open the window?

window = guiCreateWindow(325,111,482,473,"SHG User Panel",false) 
guiWindowSetSizable(window,false) 
grid1 = guiCreateGridList(242,30,228,347,false,window) 
guiGridListSetSelectionMode(grid1,2) 
guiGridListAddColumn(grid1,"Player Name",0.2) 
guiGridListAddColumn(grid1,"Wanted",0.2) 
guiSetAlpha(grid1,0.69999998807907) 
pinunpinplayer = guiCreateButton(250,392,215,69,"Pin / Unpin Player",false,window) 
EDchat = guiCreateButton(22,33,210,69,"Enable / Disable Chat",false,window) 
becomecivilanB = guiCreateButton(24,270,210,69,"Become civilan",false,window) 
suicideB = guiCreateButton(25,192,210,69,"Suicide",false,window) 
EDhud = guiCreateButton(23,112,210,69,"Enable / Disable Hud",false,window) 
shglabel = guiCreateLabel(57,372,138,61,"SHG",false,window) 
guiSetFont(shglabel,"sa-gothic") 
  
  
function resourceStart () 
  bindKey ("F4", "down", menuShow) 
end 
addEventHandler ("onClientResourceStart", getResourceRootElement ( getThisResource () ), resourceStart) 
  
function menuShow () 
    visableornot = guiGetVisible (window) 
    if (visableornot == true) then 
        guiSetVisible (window, false) 
        showCursor (false) 
    end 
    if (visableornot == false) then 
        guiSetVisible (window, true) 
        showCursor (true) 
    end 
end 
  
  

Link to comment
window = guiCreateWindow(325,111,482,473,"SHG User Panel",false) 
guiWindowSetSizable(window,false) 
grid1 = guiCreateGridList(242,30,228,347,false,window) 
guiGridListSetSelectionMode(grid1,2) 
guiGridListAddColumn(grid1,"Player Name",0.2) 
guiGridListAddColumn(grid1,"Wanted",0.2) 
guiSetAlpha(grid1,0.69999998807907) 
pinunpinplayer = guiCreateButton(250,392,215,69,"Pin / Unpin Player",false,window) 
EDchat = guiCreateButton(22,33,210,69,"Enable / Disable Chat",false,window) 
becomecivilanB = guiCreateButton(24,270,210,69,"Become civilan",false,window) 
suicideB = guiCreateButton(25,192,210,69,"Suicide",false,window) 
EDhud = guiCreateButton(23,112,210,69,"Enable / Disable Hud",false,window) 
shglabel = guiCreateLabel(57,372,138,61,"SHG",false,window) 
guiSetFont(shglabel,"sa-gothic") 
guiSetVisible( window, false ) 
  
function menuShow () 
    guiSetVisible( window, not guiGetVisible( window ) ) 
    showCursor( not isCursorShowing( ) ) 
end 
bindKey ("F4", "down", menuShow ) 

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