Raised This Month: $ Target: $400
 0% 

[TF2] Activate on spawn thing


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
StormishJustice
Member
Join Date: May 2015
Location: In a mysterious place.
Old 03-26-2016 , 16:44   Re: [TF2] Activate on spawn thing
Reply With Quote #3

Quote:
Originally Posted by Chaosxk View Post
This?

Code:
bool g_bIsGiantRobot[MAXPLAYERS+1];

public void OnPluginStart()
{
    HookEvent("player_spawn", Event_PlayerSpawn);
}

public Action Event_PlayerSpawn(Handle event, const char[] sName, bool bDontBroadcast)
{
    int client = GetClientOfUserId(GetEventInt(event, "userid"));
    if(GetClientTeam(client) == 3 && g_bIsGiantRobot[client])
    {
        GiantRobot(client);
        ReplyToCommand(client, "[Red2Robot] You are now a Giant Robot!");
        ShowActivity2(client, "[Red2Robot] ", "%N is now a Giant Robot!", client);
    }
    g_bIsGiantRobot[client] = false;
}

public Action Command_Giant(int client, int args)
{ 
    if (GetClientTeam(client) == 3)
    {
        g_bIsGiantRobot[client] = true;
        ReplyToCommand(client, "[Red2Robot] You will be a giant once you respawn.")
    }
    else if (g_bIsGiantRobot[client])
    {
        ReplyToCommand(client, "[Red2Robot] You can't be a Giant Robot again because you already are.")
    }
    else
    {
        ReplyToCommand(client, "[Red2Robot] You need to be in the BLU/Robots team in order to turn into a Giant Robot.");
    }
}
Hey that seemed to work!

but i regret it and i changed my mind, but i will use that for later if i ever wanted to do so.

EDIT: I actually used that method and it's better, except i replaced the g_bIsGiantRobot thing to g_bWantsToBeGiant just incase.
__________________

Last edited by StormishJustice; 03-27-2016 at 07:28.
StormishJustice is offline
Send a message via AIM to StormishJustice Send a message via Yahoo to StormishJustice Send a message via Skype™ to StormishJustice
 



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 21:11.


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