Raised This Month: $51 Target: $400
 12% 

How to pass cd into a task?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Shadows Adi
AlliedModders Donor
Join Date: Aug 2019
Location: Romania
Old 08-27-2020 , 06:07   How to pass cd into a task?
Reply With Quote #1

Hello,
I want to pass some client data through a task from FM_UpdateClientData hook.
I've tried this, but compiler seems not to be happy and it doesn't work:
Code:
new CDTaskData[3];         CDTaskData[0] = iPlayer;         CDTaskData[1] = CD_ID;         CDTaskData[2] = CD_Handle;         set_task(0.1, "task_reset_cd", iPlayer + TASK_DEPLOY, CDTaskData, sizeof(CDTaskData));

task_reset_cd:
Code:
public task_reset_cd(CDTaskData[]) {
    set_cd(CDTaskData[2], CDTaskData[1], 1); /* Here the compiler is not happy */
}
Compiler not happy:
PHP Code:
warning 213tag mismatch =(( 
__________________


Accepting Paid Requests, contact PM.

MVP Of The Round View project on GITHUB / AlliedModders
CSGO REMAKE ~ CSGO MOD [STABLE + SOURCE CODE]

Last edited by Shadows Adi; 08-27-2020 at 06:07.
Shadows Adi is offline
thEsp
BANNED
Join Date: Aug 2017
Old 08-27-2020 , 09:01   Re: How to pass cd into a task?
Reply With Quote #2

Tags in Pawn are implemented for awareness and their [possibly onliest] use comes when declaring floats (due to the way they're stored in memory) and loading operators. Passing ClientData:CDTaskData[1] (notice the tag) should remove that warning.

Quote:
Originally Posted by Shadows Adi View Post
Next time keep it in mind to search first

Last edited by thEsp; 08-27-2020 at 09:02.
thEsp 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 12:17.


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