AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Get info (https://forums.alliedmods.net/showthread.php?t=206508)

ironskillz1 01-23-2013 09:41

Get info
 
Can i some how get tempid in my task???
set_task( 10.0, "SawSlay")

Code:

public SawGame ( iPlayer )
{
new SawMenu = menu_create ( "\r[\ySWE-KUNG\r]\w Saw Menu:^n\rBy SnusMumrikeN", "SawGame_Handle" )
new num, players[32], tempid, szTempID [ 10 ], tempname [ 32 ]
get_players ( players, num, "a" )
for ( new i = 0; i < num; i++ )
{
tempid = players [ i ]
if ( cs_get_user_team ( tempid ) != CS_TEAM_T )
continue
get_user_name ( tempid, tempname, 31 )
num_to_str ( tempid, szTempID, 9 )
menu_additem ( SawMenu, tempname, szTempID, 0 )
}
menu_display ( iPlayer, SawMenu )
set_task( 10.0, "SawSlay")                          // TASK!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
return PLUGIN_HANDLED
}
public SawGame_Handle ( iPlayer, menu, item, id )
{
g_iCurrentGame = GAME_SAW
if ( item == MENU_EXIT )
{
menu_destroy ( menu )
return PLUGIN_HANDLED;
}
new data [ 8 ], iName [ 64 ]
new access, callback
menu_item_getinfo ( menu, item, access, data,7, iName, 63, callback )
new tempid = str_to_num ( data )
new tempname [ 32 ]
get_user_name ( tempid, tempname, 31 )
 
 
menu_destroy(menu);
return PLUGIN_HANDLED;
}
public SawSlay (id)
{
 
  }
}


Xalus 01-23-2013 10:07

Re: Get info
 
PHP Code:

set_task10.0"SawSlay"tempid)

public 
SawSlay(tempid


ironskillz1 01-23-2013 10:16

Re: Get info
 
doesnt work

Xalus 01-23-2013 10:36

Re: Get info
 
I give up..

Why you ask help, if your not even doing what we say todo?

ironskillz1 01-23-2013 10:47

Re: Get info
 
Quote:

Originally Posted by Xalus (Post 1878672)
I give up..

Why you ask help, if your not even doing what we say todo?

Solved
sorry Xalus :(

Xalus 01-23-2013 12:42

Re: Get info
 
Np,

I'm happy that you found it by urself! :)

fysiks 01-23-2013 20:45

Re: Get info
 
Quote:

Originally Posted by Xalus (Post 1878735)
Np,

I'm happy that you found it by urself! :)

Don't worry, your example was correct as an example, you just confused him by using the wrong variable (wrong in his code).


All times are GMT -4. The time now is 20:40.

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