29.07.2010, 11:18
Does someone have this for me? and it should work with GetPlayerTeam Instead of Gteam, Thanks!
stock SendTeam1Message(playerid, color, string[])
{
if(GetPlayerTeam(playerid) == 1)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && GetPlayerTeam(i) == 1)
{
SendClientMessage(i, Color, string);
}
}
}
return 0;
}
forward SendTeamMessage(teamid, color, const message[]);
public SendTeamMessage(teamid, color, const message[])
{
for(new i; i < MAX_PLAYERS; i++)
{
if(!IsPlayerConnected(i)) continue;
if(GetPlayerTeam(i) != teamid) continue;
SendClientMessage(i, color, message);
}
return 1;
}
format(string, sizeof(string), "* Radio: %s: %s", playername, message);
SendTeamMessage(GetPlayerTeam(playerid), COLOR_WHATEVER, string);
stock SendPoliceMessage(COLOR, string[]) { for(new i = 0; i < MAX_PLAYERS; i++) { if(IsPlayerConnected(i) && GetPlayerTeam(i) == 1) { SendClientMessage(i, COLOR_LIGHTBLUE, string); } } return 0; }
if((strcmp(cmd, "/r", true) == 0) || (strcmp(cmd, "/radio", true) == 0)) { if(GetPlayerTeam(playerid) == 1) { format(string, sizeof(string), "* Radio: %s: %s", pName, string); SendPoliceMessage(COLOR_LIGHTBLUE, string); } return 1; }
C:\Documents and Settings\Wouter\Bureaublad\SA-MP Scripting\pawno\PoliceFaction.pwn(293) : warning 203: symbol is never used: "COLOR" |
I tried to fix it, its now this:
Stock: Код:
stock SendPoliceMessage(COLOR, string[]) { for(new i = 0; i < MAX_PLAYERS; i++) { if(IsPlayerConnected(i) && GetPlayerTeam(i) == 1) { SendClientMessage(i, COLOR_LIGHTBLUE, string); } } return 0; } Код:
...... |
stock SendPoliceMessage(string[]) { for(new i = 0; i < MAX_PLAYERS; i++) { if(IsPlayerConnected(i) && GetPlayerTeam(i) == 1) { SendClientMessage(i, COLOR_LIGHTBLUE, string); } } return 0; }