AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   How to pass cd into a task? (https://forums.alliedmods.net/showthread.php?t=326989)

Shadows Adi 08-27-2020 06:07

How to pass cd into a task?
 
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 =(( 


thEsp 08-27-2020 09:01

Re: How to pass cd into a task?
 
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 (Post 2715483)
Next time keep it in mind to search first :)



All times are GMT -4. The time now is 13:44.

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