Team Message Error - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Team Message Error (
/showthread.php?tid=175076)
Team Message Error -
[UG]Scripter - 08.09.2010
Hai,
I have an error with my teams.
I have told my 911 system to
SendMessageToLawCode:
pawn Код:
SendMessageToLaw(const str[])
{
for (new i = 0; i < MAX_PLAYERS; i++)
{
if (IsPlayerConnected(i)) {
if (PlayerTeam[i] == Team_NSP || Team_LVPD) {
SendClientMessage(i, COLOR_CRIMBLUE, str);
}
}
}
}
I have Defined and Set My Teams;
OnPlayerConnect()
{
PlayerTeam[playerid] = Team_Civ;
return 1;
}
OnPlayerSpawn()
{
PlayerTeam[playerid] = Team_Civ;
return 1;
}
Yet, It send the message to everyone, But The Fire and EMS do not.
911 Code;
pawn Код:
case 4:
{
GetPlayerName(playerid, playername, sizeof(playername));
format(string, sizeof(string), "-------------------------------------------------------------------------------------------------------------");
SendMessageToLaw(string);
format(string, sizeof(string), "POLICE DISPATCH (911 CALL)");
SendMessageToLaw(string);
format(string, sizeof(string), "Be advised. The following is a 911 call relay.");
SendMessageToLaw(string);
format(string, sizeof(string), "Caller name: %s",playername);
SendMessageToLaw(string);
format(string, sizeof(string), "Caller ID: %d",playerid);
SendMessageToLaw(string);
format(string, sizeof(string), "Quoted information: Caller was Just Robbed");
SendMessageToLaw(string);
format(string, sizeof(string), "Caller traced location: %s",zones[current_zone][zone_name]);
SendMessageToLaw(string);
format(string, sizeof(string), "-------------------------------------------------------------------------------------------------------------");
SendMessageToLaw(string);
}
Re: Team Message Error -
Retardedwolf - 08.09.2010
Those lines which do not need to be formatted should not be formatted. e.g "---", "Police Dispatch","Be advised".
This does not have to do with the error.
SendClientMessage already has implemented check if the player is connected so the check before SCM isn't required. (Correct me If I'm wrong)
Re: Team Message Error -
Voldemort - 08.09.2010
pawn Код:
SendMessageToLaw(const str[])
{
for (new i = 0; i < MAX_PLAYERS; i++)
{
if (IsPlayerConnected(i))
{
if (PlayerTeam[i] == Team_NSP || PlayerTeam[i] == Team_LVPD)
{
SendClientMessage(i, COLOR_CRIMBLUE, str);
}
}
}
}
case 4:
{
GetPlayerName(playerid, playername, sizeof(playername));
SendMessageToLaw("-------------------------------------------------------------------------------------------------------------");
SendMessageToLaw("POLICE DISPATCH (911 CALL)");
SendMessageToLaw("Be advised. The following is a 911 call relay.");
format(string, sizeof(string), "Caller name: %s",playername);
SendMessageToLaw(string);
format(string, sizeof(string), "Caller ID: %d",playerid);
SendMessageToLaw(string);
SendMessageToLaw("Quoted information: Caller was Just Robbed");
format(string, sizeof(string), "Caller traced location: %s",zones[current_zone][zone_name]);
SendMessageToLaw(string);
SendMessageToLaw("-------------------------------------------------------------------------------------------------------------");
}
And why you ned return 1; if its Civil team?
Re: Team Message Error -
[UG]Scripter - 08.09.2010
Okay people. When I posted OnPlayerConnect Etc. That wasn't my on player connect. I typed it to show what fucntion I had under those headings. The 911 Code is part of my Unique Dialog 911 System. Then SendMessage to law code is at the top of my script.
SendMessageToLaw Sends a meesage to Team_NSP ( Nevada State Patrol ) and Team_LVPD ( Las Vegas Police Dept). But the code is some where sending it to The Civ Team even know its not meant to.
Re: Team Message Error -
[UG]Scripter - 08.09.2010
I fixed it. Thanks for the help.