Jump to content

Toggle Warp


Minotaur

Recommended Posts

Anybody please help me i want toggle warp button like falloff bike If you would like checked you can warp, If not checked you can not warp, and the person who want to warp and wished him on the warp you wrote this:this player dont allowed the warp :) thank you

Link to comment

i create this in fr_client but not work :(

--------------------------- 
-- Warp toggle 
--------------------------- 
function warpMe(targetPlayer) 
if getElementData(targetPlayer,"warp.status") then outputChatBox ( "This player has disabled warping.", source, 255, 0, 0 ) return end 
.. 

Link to comment
  • Moderators

maybe because you created something that isn't at the right place.

and it is missing an "end"

function warpTo(leaf) 
    if not leaf then 
        leaf = getSelectedGridListLeaf(wndWarp, 'playerlist') 
        if not leaf then 
            return 
        end 
    end 
    local player = getPlayerFromNick(leaf.name) 
    if player then 
        if getElementData(player,"warp.status") then outputChatBox ( "This player has disabled warping.", player, 255, 0, 0 ) return end -- added 
        server.warpMe(player) 
    end 
    closeWindow(wndWarp) 
end 
  
  
function warpToCommand(cmd, player) 
    if player then 
        player = getPlayerFromNick(player) 
        if player then 
            if getElementData(player,"warp.status") then outputChatBox ( "This player has disabled warping.", player, 255, 0, 0 ) return end --added 
            server.warpMe(player) 
        end 
    else 
        createWindow(wndWarp) 
        showCursor(true) 
    end 
end 
  
addCommandHandler('warpto', warpToCommand) 
addCommandHandler('wt', warpToCommand) 

Link to comment

thank you ;) and how to do a window like falloffbike? immediately for the falloffbike.

and i put it this to fr_client so:

--------------------------- 
-- Warp toggle 
------------------------- 
function warpTo(leaf) 
    if not leaf then 
        leaf = getSelectedGridListLeaf(wndWarp, 'playerlist') 
        if not leaf then 
            return 
        end 
    end 
    local player = getPlayerFromNick(leaf.name) 
    if player then 
        if getElementData(player,"warp.status") then outputChatBox ( "This player has disabled warping.", player, 255, 0, 0 ) return end -- added 
        server.warpMe(player) 
    end 
    closeWindow(wndWarp) 
end 
  
  
function warpToCommand(cmd, player) 
    if player then 
        player = getPlayerFromNick(player) 
        if player then 
            if getElementData(player,"warp.status") then outputChatBox ( "This player has disabled warping.", player, 255, 0, 0 ) return end --added 
            server.warpMe(player) 
        end 
    else 
        createWindow(wndWarp) 
        showCursor(true) 
    end 
end 
  
addCommandHandler('warpto', warpToCommand) 
addCommandHandler('wt', warpToCommand) 

Link to comment
  • Moderators

and i put it this to fr_client so:* 

yes, but replaced it with the old functions. (else it probably going to be bugged)

thank you ;) and how to do a window like falloffbike? immediately for the falloffbike.

Minotaur, first learn the basic. You can say at every topic that you are a "noob scripter", but that isn't help you to learn it.

You will always having the same problems and for 60% they are able to help you. But most of the time big resources get bugged after adding stuff. Simply because you change the system.

You can start with some basic stuff, most of that you can find here:

Client Scripting:

https://wiki.multitheftauto.com/wiki/Cl ... _Functions

https://wiki.multitheftauto.com/wiki/Cl ... ing_Events

Server scripting:

https://wiki.multitheftauto.com/wiki/Se ... _Functions

https://wiki.multitheftauto.com/wiki/Se ... ing_Events

Link to comment
  • Moderators

I was nice in the beginning,

But it looks like, you aren't willing to learn it on your self.

In fact you don't even try to learn anything.

The only thing you care about is having it as you want and skipping the learning part.

That isn't going to work.

I just did post the basic pages, really nice samples and easy to understand.

You should start there and don't act like a kid that isn't old enough to learn.

DO I MAKE MY SELF CLEAR?

GOOD LUCK!

and of course you can ask me anything that has related to scripting, as long it is a specific lua question and not about pathetic resources.

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