Seeing team Radio - 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)
+--- Thread: Seeing team Radio (
/showthread.php?tid=341269)
Seeing team Radio -
iOmar - 10.05.2012
Guys i did this:
pawn Код:
public OnPlayerText(playerid, text[])
{
new strName[MAX_PLAYER_NAME], strOut[129];
GetPlayerName(playerid, strName, sizeof(strName));
if(text[0] == ',') // he used ' ! ' before text in chat box ( change as you wish )
{
new string[129];
strmid(string, text, 1, strlen(text), 129);
format(strOut, 129, "[Team Radio] %s: %s", strName, string);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(gTeam[i] == gTeam[playerid]) // change this if you're not using gTeam
SendClientMessage(i, 0x00FF00FF, strOut);
}
return 0; // prevent the message to be sent on global chat
}
return 1;
}
But other team member can also see radio?? What is this?
Re: Seeing team Radio -
JaKe Elite - 10.05.2012
pawn Код:
public OnPlayerText(playerid, text[])
{
new strName[MAX_PLAYER_NAME], strOut[129];
GetPlayerName(playerid, strName, sizeof(strName));
if(text[0] == ',') // he used ' ! ' before text in chat box ( change as you wish )
{
new string[129];
strmid(string, text, 1, strlen(text), 129);
if(gTeam[playerid] == YOURTEAMHERE)
{
format(strOut, 129, "[Team Radio] %s: %s", strName, string);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(gTeam[i] == gTeam[playerid]) // change this if you're not using gTeam
SendClientMessage(i, 0x00FF00FF, strOut);
}
}
return 0; // prevent the message to be sent on global chat
}
return 1;
}
Re: Seeing team Radio -
iOmar - 10.05.2012
I have 4 teams now?
Re: Seeing team Radio -
JaKe Elite - 10.05.2012
pawn Код:
public OnPlayerText(playerid, text[])
{
new strName[MAX_PLAYER_NAME], strOut[129];
GetPlayerName(playerid, strName, sizeof(strName));
if(text[0] == ',') // he used ' ! ' before text in chat box ( change as you wish )
{
new string[129];
strmid(string, text, 1, strlen(text), 129);
if(gTeam[playerid] == YOURTEAMHERE || gTeam[playerid] == YOURTEAMHERE || gTeam[playerid] == YOURTEAMHERE || gTeam[playerid] == YOURTEAMHERE)
{
format(strOut, 129, "[Team Radio] %s: %s", strName, string);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(gTeam[i] == gTeam[playerid]) // change this if you're not using gTeam
SendClientMessage(i, 0x00FF00FF, strOut);
}
}
return 0; // prevent the message to be sent on global chat
}
return 1;
}
the example i gave last hour ago is for 1 team only. the code i gave now is for 4 teams
Re: Seeing team Radio -
iOmar - 10.05.2012
Thnx Bro.
One more request:
I have class system. When ever a player killed, the dialogue appears but i don't want that. I want that we only select class at once than if we want to change class than we use cmd (I have that cmd). So i want the class dialogue only appear at once and we select class. Than if we die we don't need to select class , it did automatically and give us previously class.
pawn Код:
public OnPlayerSpawn(playerid)
{
ShowPlayerDialog(playerid, 999, DIALOG_STYLE_LIST, "{6EF83C}Choose A Class:", "Assault Class (Need No Rank) \nSniper Class (Need Rank 3) \nEngineer Class (Need Rank 5) \nJet-Trooper Class (Need Rank 7) \nPilot Class (Need Rank 8) \nSpy Class (Need Rank 9)", "Choose","");
return 1;
}
Re: Seeing team Radio -
JaKe Elite - 10.05.2012
pawn Код:
new DialogRepeat[MAX_PLAYERS];
public OnPlayerConnect(playerid)
{
DialogRepeat[playerid] = 0;
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
DialogRepeat[playerid] = 0;
return 1;
}
public OnPlayerSpawn(playerid)
{
if(DialogRepeat[playerid] == 0)
{
DialogRepeat[playerid] = 1;
ShowPlayerDialog(playerid, 999, DIALOG_STYLE_LIST, "{6EF83C}Choose A Class:", "Assault Class (Need No Rank) \nSniper Class (Need Rank 3) \nEngineer Class (Need Rank 5) \nJet-Trooper Class (Need Rank 7) \nPilot Class (Need Rank 8) \nSpy Class (Need Rank 9)", "Choose","");
}
return 1;
}
Re: Seeing team Radio -
iOmar - 10.05.2012
No i want that when player die or some one kill him then there should not appear dialogue. But when he type a special cmd (i have it /switchclass) than he can switch class. Otherwise he can't.
Its still same..
Re: Seeing team Radio -
iOmar - 10.05.2012
And Romel team radio is not working