Quote:
Originally Posted by Chaosxk
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.
__________________