Raised This Month: $ Target: $400
 0% 

Solved [HELP]what am i doing wrong ?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 04-11-2017 , 18:53   Re: [HELP]what am i doing wrong ?
Reply With Quote #9

Just a little fix:

Code:
public Swap(id)

Code:
public Swap()

When you're gonna add a task for a player, add id+SOMENUMBERS and at your function, id -= SAMENUMBERS.

Your code didn't work because you hadn't an id in your task while you added (id) at your function. The compiler readed
Code:
switch(cs_get_user_team(0))

Code:
set_task(Float:time, "function")

Code:
public function() { }

This is the right way without an id.

Code:
set_task(Float:time, "function", id+20310)

ID example: 12

12+20310 = 20322

Code:
public function(id) {    id -= 20310 }

23022 - 20310 = 12

This is the right way with an id.

I recommend you always use a constant or define for set a task, it will be good if you want remove that task whenever you want even without an id. I mean:

Code:
const TASK_1 = 20310

or

Code:
#define TASK_1 20310

Code:
set_task(Float:time, "function", id+TASK_1)

Code:
public function(id) {    id -= TASK_1 }
__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

____________________________________________
For private works:
• Discord: EFFEXo#8850 • Steam: EFFEXo

Last edited by EFFx; 04-11-2017 at 19:07.
EFFx 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 18:01.


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