Code:
#define NUM_COLORS 7
new iColors[NUM_COLORS][3];
public OnPluginStart()
{
HookEvent("tank_spawn", tank_spawn);
iColors[0] = { 255, 0, 0 }; // Red
iColors[1] = { 0, 255, 0 }; // Green
iColors[2] = { 0, 0, 255 }; // Blue
iColors[3] = { 255, 0, 255 }; // Pink
iColors[4] = { 255, 155, 0 }; // Orange
iColors[5] = { 255, 255, 0 }; // Yellow
iColors[6] = { 0, 0, 0 }; // Black
}
public Action:tank_spawn(Handle:event, const String:name[], bool:dontBroadcast)
{
new client = GetClientOfUserId(GetEventInt(event, "userid"));
new r, g, b, random = GetRandomInt(0, NUM_COLORS-1);
r = iColors[random][0];
g = iColors[random][1];
b = iColors[random][2];
SetEntityRenderMode(client, RENDER_TRANSCOLOR)
SetEntityRenderColor(client, r, g, b, 255);
}
Can someone edit this code so the tanks always spawn red? I changed all the colors to read { 255, 0, 0 } but it doesnt work 100%. I still get some normal colored tanks. I have 8vs8 TAAANNNK server and would like to make the tanks red all the time.