03.07.2013, 04:47
Hey , i need help ,
how to add cmd /mark , to setteam script ,
example : my friends in LS ammuniton location , and i`m same setteam with my friends , and my friends type /mark , and friends position showing to teamchat , with this icon
on map , how to do that ? , that icon just showing for same setteam only in teamchat
This is setteam script
sorry for bad english
how to add cmd /mark , to setteam script ,
example : my friends in LS ammuniton location , and i`m same setteam with my friends , and my friends type /mark , and friends position showing to teamchat , with this icon
on map , how to do that ? , that icon just showing for same setteam only in teamchat
This is setteam 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(" Team Chooser from leingod"#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;
}
public OnPlayerText(playerid, text[])
{
if(text[0] == '!'){
new pn[MAX_PLAYER_NAME],m[128];
GetPlayerName(playerid,pn,sizeof(pn));
strdel(text,0,1);
format(m,sizeof(m),"{00FFFF}[TEAMCHAT] %s [%i]: %s",pn,playerid,text);
for(new i = 0; i < MAX_PLAYERS; i++){
if(IsPlayerConnected(i)){
if(LGDTeam[i] == LGDTeam[playerid]){
SendClientMessage(i,0xFFFFFFFF,m);
}
}
}
return 0;
}
else return 1;
}