Raised This Month: $ Target: $400
 0% 

sending data through set_task not working


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 02-11-2009 , 20:56   sending data through set_task not working
Reply With Quote #1

This plugin that I have written works well if I don't use tasks and just execute my command immediately (engclient_cmd), but doesn't work right with a set task delay. It looks like the data isn't being passed correctly.

Code:
PHP Code:
#include <amxmodx>
#include <hamsandwich>
public plugin_init()
{
 
register_plugin("Bot Say Sorry for TK""1.0""Fysiks")
 
RegisterHam(Ham_Killed"player""ham_player_killed",1)
}
public 
ham_player_killedvictimkillergib// killer, victim, wpnindex, hitplace, TK)
{
 
// if(!is_user_bot(killer) || victim == killer || get_user_team(killer) != get_user_team(victim))
  // return
 
 // if(task_exists(killer)) remove_task(killer)  // If bot kills two teammates less than 3 seconds apart
 
 
new idstring[3]
 
num_to_str(killeridstring,2)
 
set_task(3.0"say_sorry",killer,idstring,0)
 
server_print("Task Set %d,%s"killer,idstring)
 return
}
public 
say_sorry(idstr[])
{
 new 
idnum str_to_num(idstr)
 if(
idnumengclient_cmd(idnum,"say","Sorry!")
 
server_print("Should have been done (%d,%s)"idnumidstr)

Some Results:
Code:
 
Task Set 8,8
Task Set 5,5
Should have been done (0,mFilter)
Should have been done (0,
And yes, there was nothing after that last comma .
fysiks is offline
 



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


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