AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   set task [id] parameter (https://forums.alliedmods.net/showthread.php?t=312030)

JocAnis 11-13-2018 07:17

set task [id] parameter
 
hi guys..i know set task parameters-topics have been made hundred times, but or im stupid or idk i couldnt implement these solutions in my case, what is the thing:

PHP Code:

ent_changeid )
{
    new 
p_ent g_entcurrent_playerid ] ]
    if( 
pressedid ][ g_button_id ] )
    {
        
set_pevp_entpev_groupinfopevp_entpev_groupinfo ) | id );
        
set_task4.0"change_press"id )
    }
}
public 
change_pressid )
{
    
set_pevg_entcurrent_playerid  ]] , pev_groupinfopevg_entcurrent_playerid ]], pev_groupinfo ) & ~id )


so i wanna send in set_task this: p_ent, so change_press will cache and use that..any help is welcomed, also if this matters: new g_ent[ 500 ]

klippy 11-13-2018 08:21

Re: set task [id] parameter
 
Use the 4th and 5th parameters of set_task to pass data. Read the doc.

JocAnis 11-13-2018 10:56

Re: set task [id] parameter
 
ok read it again and tryed min 5 combinations..mostly error were Index out of bounds or Invalid entity
PHP Code:

new p_ent]
p_ent] = current_playerid 
if( 
pressedid ][ g_button_id ] )
{
    
set_pevg_entp_ent] ], pev_groupinfopevg_entp_ent[0] ], pev_groupinfo ) | id //this is working ok
    
set_task4.0"change_press"idp_entsizeofp_ent ) )
}
//and then
public change_pressidp_ent[] )
{
    
set_pevg_entp_ent] ] , pev_groupinfopevg_entp_ent[0] ], pev_groupinfo ) & ~id )


any explanation why it doesnt work is welcomed..

klippy 11-13-2018 11:23

Re: set task [id] parameter
 
I think you switched around the parameters in change_press. Data is first, then task id.

JocAnis 11-13-2018 11:30

Re: set task [id] parameter
 
hvala, to je to izgleda

thank you sir!


All times are GMT -4. The time now is 07:34.

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