Jump to content

[Help]player collide


Perfect

Recommended Posts

Posted

Hi all, i want to know how to make player like a ghost ? i mean players can go through players

which functions i can use or can someone make for me pls ? i wanted that with command /ghost then ghostmode on

Multi Theft Auto Player since middle of 2011.

Everybody want to act Crazy/Smart/Intelligent/Different/Unique/Innocent and Thats why I am Perfect.

Posted

ghost mode are not abble on your gamemode settings?

My scripts: toptimes on scoreboard (server21)

Screen on login(scren)

Score on scoreboard (score)

Posted
ghost mode are not abble on your gamemode settings?

not car ghost mode, i mean players. if i type /ghost then they or car can go through from me

Multi Theft Auto Player since middle of 2011.

Everybody want to act Crazy/Smart/Intelligent/Different/Unique/Innocent and Thats why I am Perfect.

Posted
Search in Community.mtasa.com

i can't find any

Multi Theft Auto Player since middle of 2011.

Everybody want to act Crazy/Smart/Intelligent/Different/Unique/Innocent and Thats why I am Perfect.

Posted

use this:

setElementCollidableWith 

(offtopic: spark.... GHOST MODE)

My scripts: toptimes on scoreboard (server21)

Screen on login(scren)

Score on scoreboard (score)

Posted
use this:
setElementCollidableWith 

(offtopic: spark.... GHOST MODE)

ah, thnx

I tried, can you check please!

function playerghostmode() 
    local localplayer = getLocalPlayer(source) 
    for index,player in ipairs(getElementsByType("player")) do  
        setElementCollidableWith(player, localplayer, false) 
                        outputChatBox("Server: Ghostmod: on", thePlayer, 0, 255, 0 ) 
                 else   
                        setElementCollidableWith(player, localplayer, false) 
                        outputChatBox("Server: Ghostmode: off", thePlayer, 0, 255, 0 ) 
              end 
end 
addCommandHandler("ghostmode", playerghostmode)  

Multi Theft Auto Player since middle of 2011.

Everybody want to act Crazy/Smart/Intelligent/Different/Unique/Innocent and Thats why I am Perfect.

Posted

i think that is correct,(i cant see now) but "ghostmode off" should be "true" not "false"

My scripts: toptimes on scoreboard (server21)

Screen on login(scren)

Score on scoreboard (score)

Posted
i think that is correct,(i cant see now) but "ghostmode off" should be "true" not "false"

ah thnx, i forgot :P

Multi Theft Auto Player since middle of 2011.

Everybody want to act Crazy/Smart/Intelligent/Different/Unique/Innocent and Thats why I am Perfect.

Posted
why the mixed player arguments?

you mean why there is localplayer,player,thePlayer ?

If that, thnx i typed fastly, so i forgot :P

EDIT: can you correct my code please if that is wrong ?

EDIT: Warning:playerghost/ghost.lua:6: 'end' expected (to close 'for' at line 3) near 'else' . please help!!!

Multi Theft Auto Player since middle of 2011.

Everybody want to act Crazy/Smart/Intelligent/Different/Unique/Innocent and Thats why I am Perfect.

Posted
function playerghostmode() 
    local localplayer = getLocalPlayer(source) 
    for index,player in ipairs(getElementsByType("player")) do  
        setElementCollidableWith(player, localplayer, false) 
                        outputChatBox("Server: Ghostmod: on", thePlayer, 0, 255, 0 ) 
                 else   
                        setElementCollidableWith(player, localplayer, true) 
                        outputChatBox("Server: Ghostmode: off", thePlayer, 0, 255, 0 ) 
              end 
end 
addCommandHandler("ghostmode", playerghostmode)  

try it

My scripts: toptimes on scoreboard (server21)

Screen on login(scren)

Score on scoreboard (score)

Posted
function playerghostmode() 
    local localplayer = getLocalPlayer(source) 
    for index,player in ipairs(getElementsByType("player")) do  
        setElementCollidableWith(player, localplayer, false) 
                        outputChatBox("Server: Ghostmod: on", thePlayer, 0, 255, 0 ) 
                 else   
                        setElementCollidableWith(player, localplayer, true) 
                        outputChatBox("Server: Ghostmode: off", thePlayer, 0, 255, 0 ) 
              end 
end 
addCommandHandler("ghostmode", playerghostmode)  

try it

same errors Warning:playerghost/ghost.lua:6: 'end' expected (to close 'for' at line 3) near 'else'

Multi Theft Auto Player since middle of 2011.

Everybody want to act Crazy/Smart/Intelligent/Different/Unique/Innocent and Thats why I am Perfect.

Posted (edited)
function playerghostmode() 
    local localplayer = getLocalPlayer(source) 
    for index,player in ipairs(getElementsByType("player")) do  
        setElementCollidableWith(player, localplayer, false) 
                        outputChatBox("Server: Ghostmod: on", source, 0, 255, 0 ) 
                 else   
                        setElementCollidableWith(player, localplayer, true) 
                        outputChatBox("Server: Ghostmode: off", source, 0, 255, 0 ) 
                 end 
        end 
end 
addCommandHandler("ghostmode", playerghostmode)  

TRY THIS

Edited by Guest

My scripts: toptimes on scoreboard (server21)

Screen on login(scren)

Score on scoreboard (score)

Posted
function playerghostmode() 
    local localplayer = getLocalPlayer(source) 
    for index,player in ipairs(getElementsByType("player")) do  
        setElementCollidableWith(player, localplayer, false) 
                        outputChatBox("Server: Ghostmod: on", source, 0, 255, 0 ) 
                 else   
                        setElementCollidableWith(player, localplayer, true) 
                        outputChatBox("Server: Ghostmode: off", source, 0, 255, 0 ) 
              end 
end 
addCommandHandler("ghostmode", playerghostmode)  

srry for 2ble post TRY IT

same errors Warning:playerghost/ghost.lua:6: 'end' expected (to close 'for' at line 3) near 'else'

Multi Theft Auto Player since middle of 2011.

Everybody want to act Crazy/Smart/Intelligent/Different/Unique/Innocent and Thats why I am Perfect.

Posted

try with the last (i modified it)

My scripts: toptimes on scoreboard (server21)

Screen on login(scren)

Score on scoreboard (score)

Posted
try with the last (i modified it)

same errors again Warning:playerghost/ghost.lua:6: 'end' expected (to close 'for' at line 3) near 'else'

Multi Theft Auto Player since middle of 2011.

Everybody want to act Crazy/Smart/Intelligent/Different/Unique/Innocent and Thats why I am Perfect.

Posted
¿you put it on client?

no

Multi Theft Auto Player since middle of 2011.

Everybody want to act Crazy/Smart/Intelligent/Different/Unique/Innocent and Thats why I am Perfect.

Posted
function playerghostmode() 
    local localplayer = getLocalPlayer(source) 
       for index,player in ipairs(getElementsByType("player")) do  
        setElementCollidableWith(player, localplayer, false) 
                        outputChatBox("Server: Ghostmod: on", source, 0, 255, 0 ) 
                 else   
                        setElementCollidableWith(player, localplayer, true) 
                        outputChatBox("Server: Ghostmode: off", source, 0, 255, 0 ) 
                 end 
        end 
end 
addCommandHandler("ghostmode", playerghostmode)  

TRY THIS

use that and put it on client

My scripts: toptimes on scoreboard (server21)

Screen on login(scren)

Score on scoreboard (score)

Posted
function playerghostmode() 
    local localplayer = getLocalPlayer(source) 
       for index,player in ipairs(getElementsByType("player")) do  
        setElementCollidableWith(player, localplayer, false) 
                        outputChatBox("Server: Ghostmod: on", source, 0, 255, 0 ) 
                 else   
                        setElementCollidableWith(player, localplayer, true) 
                        outputChatBox("Server: Ghostmode: off", source, 0, 255, 0 ) 
                 end 
        end 
end 
addCommandHandler("ghostmode", playerghostmode)  

TRY THIS

use that and put it on client

Still same error

Multi Theft Auto Player since middle of 2011.

Everybody want to act Crazy/Smart/Intelligent/Different/Unique/Innocent and Thats why I am Perfect.

Posted
what debugscript 3 says?

WARNING: Loading script failed: player_ghostmode\pghost.lua:6: 'end' expected (to close 'for' at line 3) near 'else'

Multi Theft Auto Player since middle of 2011.

Everybody want to act Crazy/Smart/Intelligent/Different/Unique/Innocent and Thats why I am Perfect.

Posted

You can't use 'else' without an 'if'.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

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