AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   How to give long jump to a player? (https://forums.alliedmods.net/showthread.php?t=90287)

alan_el_more 04-16-2009 08:16

How to give long jump to a player?
 
How to give long jump to a player?
without the item long jump
thanks in advance :D

ot_207 04-16-2009 08:18

Re: How to give long jump to a player?
 
PHP Code:


stock fm_set_user_longjump
(indexbool:longjump truebool:tempicon true) {
    if (
longjump == fm_get_user_longjump(index))
        return

    if (
longjump) {
        
engfunc(EngFunc_SetPhysicsKeyValueindex"slj""1")
        if (
tempicon) {
            static 
msgid_itempickup
            
if (!msgid_itempickup)
                
msgid_itempickup get_user_msgid("ItemPickup")

            
message_begin(MSG_ONEmsgid_itempickup_index)
            
write_string("item_longjump")
            
message_end()
        }
    }
    else
        
engfunc(EngFunc_SetPhysicsKeyValueindex"slj""0")



alan_el_more 04-16-2009 08:23

Re: How to give long jump to a player?
 
shows a flash showing the item longjump?

ot_207 04-16-2009 08:26

Re: How to give long jump to a player?
 
Quote:

Originally Posted by alan_el_more (Post 806726)
shows a flash showing the item longjump?

Flash? You mean the Statusicon?

hleV 04-16-2009 08:26

Re: How to give long jump to a player?
 
You could try this:
Code:
#include <fun>   public Function(Client) {         // Still not sure if it's "item_longjump"         give_item(Client, "item_longjump"); }

alan_el_more 04-16-2009 08:27

Re: How to give long jump to a player?
 
Quote:

Originally Posted by ot_207 (Post 806730)
Flash? You mean the Statusicon?

yes

@hleV
without the item long jump

ot_207 04-16-2009 08:28

Re: How to give long jump to a player?
 
Quote:

Originally Posted by hleV (Post 806731)
You could try this:
Code:
#include <fun>   public Function(Client) {         // Still not sure if it's "item_longjump"         give_item(Client, "item_longjump"); }

Quote:

without the item long jump
Quote:

Originally Posted by alan_el_more (Post 806732)
yes

Send the statusicon message after setting long jump.

alan_el_more 04-16-2009 08:36

Re: How to give long jump to a player?
 
I put this:
PHP Code:

fm_set_user_longjump(id10

For that do not appear the statusicon but has an error.

And I need the native fm_get_user_longjump.

ot_207 04-16-2009 08:38

Re: How to give long jump to a player?
 
PHP Code:

stock bool:fm_get_user_longjump(index) {
    new 
value[2];
    
engfunc(EngFunc_GetPhysicsKeyValueindex"slj"value1);
    switch (
value[0]) {
        case 
'1': return true;
    }

    return 
false;


edit:
fm_set_user_longjump(id, true, false)

Dores 04-16-2009 13:40

Re: How to give long jump to a player?
 
Quote:

Originally Posted by ot_207 (Post 806749)
fm_set_user_longjump(id, true, false)

1 equals to true and 0 equals to false in Pawn("dumb" compiler). What he did is the same.


All times are GMT -4. The time now is 02:28.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.