Raised This Month: $ Target: $400
 0% 

[help]set_task


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Lord94
Junior Member
Join Date: Aug 2018
Old 08-28-2019 , 15:15   [help]set_task
Reply With Quote #1

Trying to set_task to this funcion, but it executes to server :/
Code:
public sTask(id){         new szName[ 32 ];     read_argv( 1, szName, charsmax( szName ) );         new iPlayer = cmd_target( id, szName, CMDTARGET_ALLOW_SELF )         new victim[32];     get_user_name(iPlayer,victim,31)                 client_cmd(iPlayer, "+jump")     for( new i = 1; i <= g_iMaxPlayers ; i++ )     {         if( get_user_flags(i) & ADMIN_CHAT )         {             ColorChat(i, RED, "[REC] Player %s is now being checked",victim)                     }     }     return PLUGIN_HANDLED } public sRecord( id, iLevel, iCid ) {     if ( ! cmd_access( id, iLevel, iCid, 2 ) )         return PLUGIN_HANDLED         new szName[ 32 ];     read_argv( 1, szName, charsmax( szName ) );         new iPlayer = cmd_target( id, szName, CMDTARGET_ALLOW_SELF );         new victim[32];     get_user_name(iPlayer,victim,31)         if( ! is_user_connected( iPlayer ) )     {         client_print( id, print_console, "(!) Player could not found" );         return PLUGIN_HANDLED;     }     if (! is_user_alive( iPlayer ) ){         client_print( id, print_console, "(!) This action cannot be performed on a dead player" );         return PLUGIN_HANDLED;     }         client_cmd(id, "stop; record %s", victim)     set_task(2.0, "sTask")         for( new i = 1; i <= g_iMaxPlayers ; i++ )     {         if( get_user_flags(i) & ADMIN_CHAT )         {             ColorChat(i, RED, "[Check Up] ^1Recording to^3 %s.dem",victim)                     }     }     return PLUGIN_HANDLED }
Lord94 is offline
iceeedr
Veteran Member
Join Date: Apr 2017
Location: Brazil
Old 08-28-2019 , 15:35   Re: [help]set_task
Reply With Quote #2

Pass the player id

set_task(2.0, "sTask", iPlayer)
__________________


Quote:
Originally Posted by fysiks View Post
Please stop trying to help. You appear to just be posting random stuff. Wait until you actually understand more about AMX Mod X and how the game works.
https://iceeedr.com.br/

Last edited by iceeedr; 08-28-2019 at 15:35.
iceeedr is offline
Send a message via Skype™ to iceeedr
JocAnis
Veteran Member
Join Date: Jun 2010
Old 08-28-2019 , 15:38   Re: [help]set_task
Reply With Quote #3

set_task( 2.0, "sTask", iPlayer )

Also i think client_cmd should go with iPlayer not id

If u can show full code of it i would love it, seems like something for catching ret*rds
__________________
KZ Public Autocup - PrimeKZ

My blog: http://primekz.xyz (in progress...) - not active (dec 2022)
JocAnis is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 17:25.


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