Raised This Month: $ Target: $400
 0% 

Solved Setting user team with client_cmd


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
CouldYouPlease051
Junior Member
Join Date: Mar 2017
Old 03-21-2017 , 11:00   Setting user team with client_cmd
Reply With Quote #1

PHP Code:
public handleJoin(id) {
  if(
bool:g_PlayerData[id][inTeam] == true) {
    return 
PLUGIN_HANDLED_MAIN;
  }

  return 
PLUGIN_CONTINUE;

Handles jointeam and joinclass commands.
This part in the function is causing me problems:
PHP Code:
g_PlayerData[id][inTeam] = false;
client_cmd(id"jointeam 1");
client_cmd(id"joinclass 5");
//g_PlayerData[id][inTeam] = true; 
If the boolean is commented out, it works perfectly, when it's not .. it won't work. I have an idea that I must have a longer delay when setting inTeam to true again but that would require me to create a task..

Am I doing anything wrong? Is there a better way so I wouldn't have to set a task?

Last edited by CouldYouPlease051; 03-21-2017 at 16:52.
CouldYouPlease051 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:59.


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