02.07.2013, 14:00
how to make team chat on setteam ?
example , i`m /setteam 1 , and teamchat can showing for player on /setteam 1
how to make it on this script
Sorry for bad english
example , i`m /setteam 1 , and teamchat can showing for player on /setteam 1
how to make it on this script
pawn Код:
#include <a_samp>
#include <zcmd>
#include <dini>
#include <sscanf>
// COLORS
#define usage 0xFFEEC1AA
#define error 0xFF3434AA
#define lancar 0x34C6FFAA
// DEFINES
#define version_team_chooser "1.0"
enum LData
{
Team
};
new TeamInfo[MAX_PLAYERS][LData];
new LGDTeam[MAX_PLAYERS];
public OnFilterScriptInit()
{
print("\n----------------------------------------------------");
print(" Running FilterScript Leingod's team chooser v"#version_team_chooser"");
print("----------------------------------------------------\n");
return 1;
}
public OnPlayerConnect(playerid)
{
new LName[MAX_PLAYER_NAME], file[128];
GetPlayerName(playerid,LName,sizeof(LName));
format(file,sizeof(file),"Teams/%s.ini",LName);
if(!dini_Exists(file))
{
dini_Create(file);
dini_IntSet(file,"Team",TeamInfo[playerid][Team]);
new rteam = random(-999999999999);
LGDTeam[playerid] = rteam;
}
if(dini_Exists(file))
{
TeamInfo[playerid][Team] = dini_Int(file,"Team");
LGDTeam[playerid] = dini_Int(file,"Team");
}
return 1;
}
// ZCMD COMMANDS
COMMAND:setteam(playerid, params[])
{
new LTeam;
#pragma unused params
if(sscanf(params, "d", LTeam)) return SendClientMessage(playerid, usage, "[USAGE]: /setteam [1-999,999]");
else if (LTeam >= 999999 || LTeam == 0) return SendClientMessage(playerid, error, "[ERROR]: Team id must between 1 and 999,999");
else
{
new string[128], LName[MAX_PLAYER_NAME], file[128];
format(string, sizeof(string), "[SERVER]: Success choosing team id -> '%d'.", LTeam);
SendClientMessage(playerid, lancar, string);
LGDTeam[playerid] = LTeam;
SetPlayerTeam(playerid, LGDTeam[playerid]);
SetPlayerTeam(playerid, LTeam);
GetPlayerName(playerid,LName,sizeof(LName));
format(file,sizeof(file),"Teams/%s.ini",LName);
dini_IntSet(file,"Team",LGDTeam[playerid]);
}
return 1;
}
COMMAND:myteam(playerid, params[])
{
new str[256];
#pragma unused params
format(str, sizeof(str), "[SERVER]: Your team id -> '%d'.", LGDTeam);
SendClientMessage(playerid, lancar, str);
return 1;
}
COMMAND:resetteam(playerid, params[])
{
new rteam = random(-999999999999), LName[MAX_PLAYER_NAME], file[128];
#pragma unused params
LGDTeam[playerid] = rteam;
SetPlayerTeam(playerid, LGDTeam[playerid]);
SendClientMessage(playerid, usage, "[SERVER]: Success make your team to netral, Everybody are enemy!.");
GetPlayerName(playerid,LName,sizeof(LName));
format(file,sizeof(file),"Teams/%s.ini",LName);
dini_IntSet(file,"Team",LGDTeam[playerid]);
return 1;
}
COMMAND:teamhelp(playerid, params[])
{
#pragma unused params
SendClientMessage(playerid, usage, "Team Set Helps:");
SendClientMessage(playerid, lancar, "/setteam = for selecting teams with the numbered id");
SendClientMessage(playerid, lancar, "/myteam = for see your team id");
SendClientMessage(playerid, lancar, "/resetteam = for setting your team to netral");
SendClientMessage(playerid, error, "TeamChooser credits: leingod the creator of this command");
return 1;
}