15.06.2014, 16:15
(
Последний раз редактировалось superrobot48; 21.06.2014 в 16:59.
)
Hi guys this is an include which contains some SendClientMessage functions to make work simple
Functions are :
GetDistanceBetweenPlayers(playerid1,playerid2)
This function is used to get players in a distance
This is a simplified version of SendClientMessage, the format's the same
eg,
************************************************** ************************
SCMToTeam(teamid,color,message);
This is a function to Send Messages to all player in a team.
eg,
************************************************** *************************
SCMToNearbyPlayers(playerid,color,message[],distance)
This function is to Send Your message to the people you nearby in a specified distance.
eg,
where playerid is the person who is the Producer of the text, the people near the playerid will get the message
and distance is the range of voice
************************************************** ******************************
Code:
Download : http://www.mediafire.com/view/nclt61ypmq9tddt/SCM.inc
Functions are :
GetDistanceBetweenPlayers(playerid1,playerid2)
This function is used to get players in a distance
pawn Код:
SCM(playerid,color,message);
eg,
pawn Код:
SCM(playerid,-1,"Hi);
SCMToTeam(teamid,color,message);
This is a function to Send Messages to all player in a team.
eg,
pawn Код:
SCMToTeam(TEAM_COP,-1,"[COP RADIO] ALL COPS THIS IS A TEST"); // the team_cop can even be a integer
SCMToNearbyPlayers(playerid,color,message[],distance)
This function is to Send Your message to the people you nearby in a specified distance.
eg,
pawn Код:
SCMToNearbyPlayersOfPlayer(playerid,-1,"lol",4);
and distance is the range of voice
************************************************** ******************************
Code:
pawn Код:
#if defined _SCM_included
#endinput
#endif
/*Made by superrobot48
any one can use this , edit this but DONT EVEN THINK ABOUT RELEASING IT IN YOUR NAME */
#define SCM SendClientMessage
#define SCMToAll SendClientMessageToAll
stock Float:GetDistanceBetweenPlayers(p1,p2){
new Float:x1,Float:y1,Float:z1,Float:x3,Float:y3,Float:z3;
if (!IsPlayerConnected(p1) || !IsPlayerConnected(p2)){
return -1.00;
}
GetPlayerPos(p1,x1,y1,z1);
GetPlayerPos(p2,x3,y3,z3);
return floatsqroot(floatpower(floatabs(floatsub(x3,x1)),2)+floatpower(floatabs(floatsub(y3,y1)),2)+floatpower(floatabs(floatsub(z3,z1)),2));
}
stock SCMToTeam(teamid,COLOR,message[])
{
for(new i=0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(GetPlayerTeam(i) == teamid)
{
SendClientMessage(i,COLOR,message);
}
}
}
return 1;
}
stock SCMToNearbyPlayersOfPlayer(playerid,color,message[],Float:distance)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(GetDistanceBetweenPlayers(i,playerid) < distance)
{
SCM(i,color,message);
}
}
}
}