Raised This Month: $51 Target: $400
 12% 

Random Number Generator TF2


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Zoker
New Member
Join Date: Jan 2023
Old 01-29-2023 , 06:17   Random Number Generator TF2
Reply With Quote #1

Hi, I'm trying to make a random number generator for TF2 and I'm a little confused. I'm not very proficient at coding but this is what I have so far. At the start of every round I'm trying to have it input a random number 1-9 in game chat.

#include <sourcemod>
#include <tf2_stocks>

public OnPluginStart()
{
HookEvent("player_spawn", Event_Spawn);
}

public random()
{
import random
n = random.randint(1,9)
{
ServerCommand("say
}

public Action:Event_Spawn(Handle:event, const String:name[], bool:dontBroadcast)
{
new client = GetClientOfUserId(GetEventInt(event, "userid"));
if (client <= 0 || client > MaxClients) return;
new teamid = GetClientTeam(client)
if(teamid == 2)
{
ServerCommand("say ")
}
}

Last edited by Zoker; 01-29-2023 at 06:19.
Zoker is offline
Reply



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 15:33.


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