Jump to content

The gui show upp for all when a player die


villr

Recommended Posts

Posted

Hi im making a rpg script right now and when a player die i want the gui to show up again but when a player dies it show for all...

Here is code

addEventHandler( "onClientPlayerWasted", getLocalPlayer( ), 
    function( ) 
          guiSetVisible (spawnmenugrid, true ) 
          guiSetVisible(spawnmenumemo,true) 
          showCursor ( true ) 
          showPlayerHudComponent("radar",false) 
                showChat(false) 
    end) 
  

What is wrong?

Why does it show for all?? :?::?:

Happy Owner/Leader of SELS:RPG | Cops and Gangsters | TRUE CRIME CITY with a lot of JOBS!

Scripted since summer 2010 :)

Posted

looks fine, should be visible only for local player O_O - maybe theres a bug, but bugtracker is down..

try onClientPedWasted instead (attached to getLocalPlayer() of course) - it's almost the same

Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online!

programista php rzeszów

Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting.

Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!

Posted

so i dont will remove getLocalPlayer?

It will be on same place?

And remove OnClientplayerblablabla

adn put in OnClientped blabla?

Happy Owner/Leader of SELS:RPG | Cops and Gangsters | TRUE CRIME CITY with a lot of JOBS!

Scripted since summer 2010 :)

  • Moderators
Posted
so i dont will remove getLocalPlayer?

It will be on same place?

And remove OnClientplayerblablabla

adn put in OnClientped blabla?

Sounds like it

Posted

hmm i get a error about getlocalplayer

attempt to call global 'getLocalPlayer'

It what error said

I havent try it yet but why it comes a error?

Happy Owner/Leader of SELS:RPG | Cops and Gangsters | TRUE CRIME CITY with a lot of JOBS!

Scripted since summer 2010 :)

Posted

you probably forgot about brackets -> ()

getLocalPlayer() 

not

getLocalPlayer 

Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online!

programista php rzeszów

Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting.

Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!

Posted

Still get that error message in Console

Happy Owner/Leader of SELS:RPG | Cops and Gangsters | TRUE CRIME CITY with a lot of JOBS!

Scripted since summer 2010 :)

Posted

The code is now

addEventHandler( "onClientPedWasted",getLocalPlayer()), 
    function( ) 
          guiSetVisible (spawnmenugrid, true ) 
          guiSetVisible(spawnmenumemo,true) 
          showCursor ( true ) 
          showPlayerHudComponent("radar",false) 
                showChat(false) 
    end) 
  

Is it right?

Happy Owner/Leader of SELS:RPG | Cops and Gangsters | TRUE CRIME CITY with a lot of JOBS!

Scripted since summer 2010 :)

Posted

Oh that error code was from a other script :P Sorry for that but we have try the script but it dont work so u know how to fix it or u think its a bug?

Happy Owner/Leader of SELS:RPG | Cops and Gangsters | TRUE CRIME CITY with a lot of JOBS!

Scripted since summer 2010 :)

Posted
  
addEventHandler( "onClientPedWasted",getLocalPlayer(), -- one ) goes out 
    function( ) 
          guiSetVisible (spawnmenugrid, true ) 
          guiSetVisible(spawnmenumemo,true) 
          showCursor ( true ) 
          showPlayerHudComponent("radar",false) 
                showChat(false) 
    end) 
  

Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online!

programista php rzeszów

Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting.

Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!

Posted

Haha im very ^^ so what shold be there? Is the -- a nedd or something or should i remove the last one or something?

Haha im just a little^^^^ nooby:P

Im a new scripter

Happy Owner/Leader of SELS:RPG | Cops and Gangsters | TRUE CRIME CITY with a lot of JOBS!

Scripted since summer 2010 :)

Posted

maybe try:

addEventHandler( "onClientPlayerWasted", getLocalPlayer( ), 
     function( ) 
          if source == getLocalPlayer( ) 
           guiSetVisible (spawnmenugrid, true ) 
           guiSetVisible(spawnmenumemo,true) 
          showCursor ( true ) 
          showPlayerHudComponent("radar",false) 
               showChat(false) 
         end 
     end) 

Posted

after -- there is my comment (lua will not parse anthing after --) about what you did wrong in last script.

you can copy & paste and use it, even with that comment

Wojak fixed script: (his idea can be good one, if onClientPlayerWasted triggers for all players even when attached to getLocalPlayer() - but have you tried onClientPedWasted successfully?)

  
addEventHandler( "onClientPlayerWasted", getLocalPlayer( ), 
     function( ) 
          if source == getLocalPlayer( ) then -- Wojak forgot about "then" here 
           guiSetVisible (spawnmenugrid, true ) 
           guiSetVisible(spawnmenumemo,true) 
          showCursor ( true ) 
          showPlayerHudComponent("radar",false) 
               showChat(false) 
         end 
     end) 
  

Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online!

programista php rzeszów

Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting.

Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!

Posted

Thx guys i will try now :) hope it works :)

Happy Owner/Leader of SELS:RPG | Cops and Gangsters | TRUE CRIME CITY with a lot of JOBS!

Scripted since summer 2010 :)

Posted

Not working :(

Happy Owner/Leader of SELS:RPG | Cops and Gangsters | TRUE CRIME CITY with a lot of JOBS!

Scripted since summer 2010 :)

Posted

post your current script

Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online!

programista php rzeszów

Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting.

Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!

Posted

The code dosent work :(

Still when a player die the gui show up :(

Do the gui need to be in a window or something beacuse my spawning gui is only a gridlist...?

Happy Owner/Leader of SELS:RPG | Cops and Gangsters | TRUE CRIME CITY with a lot of JOBS!

Scripted since summer 2010 :)

Posted
post your current script

Code or script?

With script do u mean all in the script or only codes?

I wanna send them in msn if u goot :P

Happy Owner/Leader of SELS:RPG | Cops and Gangsters | TRUE CRIME CITY with a lot of JOBS!

Scripted since summer 2010 :)

Posted

I mean if its a script i send by msn or hotmail or if a only a code of it or something i post it here

Happy Owner/Leader of SELS:RPG | Cops and Gangsters | TRUE CRIME CITY with a lot of JOBS!

Scripted since summer 2010 :)

Posted

Could You please use edit button instead of triple posting?

I meant the part that is not working.probably same part as in first post.id like to see what have you changed since first post

Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online!

programista php rzeszów

Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting.

Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!

Posted

Hmm im starting to think about one thing in script...

What are the funciton doing is it requied or i need to remove it??

First script was

addEventHandler( "onClientPlayerWasted", getLocalPlayer( ), 
    function( ) 
          guiSetVisible (spawnmenugrid, true ) 
          guiSetVisible(spawnmenumemo,true) 
          showCursor ( true ) 
          showPlayerHudComponent("radar",false) 
                showChat(false) 
    end) 
  
  

and now it is

addEventHandler( "onClientPlayerWasted", getLocalPlayer( ), 
     function( ) 
          if source == getLocalPlayer( ) then -- Wojak forgot about "then" here 
           guiSetVisible (spawnmenugrid, true ) 
           guiSetVisible(spawnmenumemo,true) 
          showCursor ( true ) 
          showPlayerHudComponent("radar",false) 
               showChat(false) 
         end 
     end) 
  
  

Happy Owner/Leader of SELS:RPG | Cops and Gangsters | TRUE CRIME CITY with a lot of JOBS!

Scripted since summer 2010 :)

Posted

and is it working or not?

even heard about debugging?

  
addEventHandler( "onClientPlayerWasted", getLocalPlayer( ), 
  function( ) 
    if source == getLocalPlayer( ) then -- Wojak forgot about "then" here 
      local name = getPlayerName(source) 
      outputDebugString("player that died: "..name..", local player: "..getPlayerName(getLocalPlayer())) 
      guiSetVisible (spawnmenugrid, true ) 
      guiSetVisible(spawnmenumemo,true) 
      showCursor ( true ) 
      showPlayerHudComponent("radar",false) 
      showChat(false) 
    end 
  end 
) 
  

Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online!

programista php rzeszów

Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting.

Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!

Posted

I will try that new code :)

hope it works

If u mean that /debugscript so yea i heard about it

Its not on my server im testing but im admin there so i can check and the gui are showing upp for people when the die but i will try the new

Happy Owner/Leader of SELS:RPG | Cops and Gangsters | TRUE CRIME CITY with a lot of JOBS!

Scripted since summer 2010 :)

Posted

No, I DONT MEAN debugscript - debugscript is only a window - and you should learn how to do thing called debug - so read that wiki page i posted!!

Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online!

programista php rzeszów

Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting.

Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!

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