Jump to content

I can't disable ghostmode


TheMtaUser555

Recommended Posts

Posted

-- client-side

[code]addEvent("enableHover",true) 
addEventHandler("enableHover",root, 
   function (enable) 
      setWorldSpecialPropertyEnabled("hovercars",enable) 
     for k,thePlayer in ipairs(getElementsByType('player')) do 
        setElementData( thePlayer, "overrideCollide.uniqueblah", 255, false ) --i tried 'true', didn't work, i tried to set 255 to 0, still nothing and tried nil, nothing. 
       outputChatBox ( "GhostMode Disabled!", getRootElement(), 255, 0, 0, true ) 
   end 
   end 
) 
  
addEvent('onClientMapStarting', true) 
   function GhostMode() 
      for k,thePlayer in ipairs(getElementsByType('player')) do 
      setElementData( thePlayer, "overrideCollide.uniqueblah", 0, true) 
     end     
   end 
addEventHandler('onClientMapStarting', getRootElement(), GhostMode) 
[/code] 

-- server-side

[code]addEvent("onPlayerReachCheckpoint") 
addEventHandler("onPlayerReachCheckpoint",root, 
   function (cp) 
      if cp == 5 then 
         triggerClientEvent(source,"enableHover",root,true) 
         end 
   end 
)[/code] 

The only thing that doesn't work is when I reach the 5th checkpoint, the ghostmode it's still on..and Id'like to disable it when the player reaches there, please help and thanks.

Posted
why don't you do this serverside? It seems odd changing remote players' ghostmode

I want the person that reaches the 5th cp to have his ghostmode disabled, not everyone..I'll will try serverside then but I don't think it's gonna work the way I want to tho

Posted

setElementData( source, "overrideCollide.uniqueblah", nil, false )

so use this line instead of triggering a client event @ cp5

also put ghostmode on serverside onMapStarting

Posted
maybe ur problem in client

use this client

http://www.mediafire.com/?324ymf7a28cfedz

sorry the code of this client crypted

i cant see the code

and trye to add

onRequestGhostMode or function onRecieveGhostModeFromServer

something like that but im not sure

^_^:D

waaaaaaaa

omg omg omg omg omg omg omg omg omg omg omg omg omg omg omg omg omg omg omg omg omg omg

Please say this not my Script Client-side Please

lol lol lol lol lol lol lol lol lol lol lol lol lol lol lol lol lol lol lol lol lol lol lol lol lol

edit:

Seriously what do you think this client do?

Posted
setElementData( source, "overrideCollide.uniqueblah", nil, false )

so use this line instead of triggering a client event @ cp5

also put ghostmode on serverside onMapStarting

thanks for the help, it's working now.(serverside)

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