SA-MP Forums Archive
[Problme]Team Chat - 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: [Problme]Team Chat (/showthread.php?tid=107414)



[Problme]Team Chat - Hor1z0n - 09.11.2009

Код:
	if(!strcmp(cmdtext,"/g", true,2))
	if(!strlen(cmdtext[2])) return SendClientMessage(playerid, 0xAFAFAFAA, "USAGE: /g(roove)");
 	if(gTeam[playerid] != TEAM_GROVE) return SendClientMessage(playerid, 0xAFAFAFAA, "You can't use this command !");
  new playername[MAX_PLAYER_NAME], string[128];
  GetPlayerName(playerid, playername, sizeof(playername));
	format(string, sizeof(string), "* *Groove [%s]: %s,", playername, cmdtext[2]);
 	for(new i = 0; i < MAX_PLAYERS; i++) {
 	}
	return 1;
}
Wath's wrong


Re: [Problme]Team Chat - dice7 - 09.11.2009

pawn Код:
if(gTeam[i] == TEAM_GROVE)
{
  SendPlayerMessageToPlayer(i, playerid, string);
}
Inside the loop



Re: [Problme]Team Chat - Hor1z0n - 10.11.2009

this didn't work 100%
now appears something like this



Re: [Problme]Team Chat - AKA_Cross - 10.11.2009

pawn Код:
if(strcmp(cmd, "/groove", true) == 0 || strcmp(cmd, "/g", true) == 0)
{
    if(IsPlayerConnected(playerid))
    {
        if(!strlen(cmdtext[2])) return SendClientMessage(playerid, 0xAFAFAFAA, "USAGE: /g(roove)");
        if(gTeam[playerid] != TEAM_GROVE) return SendClientMessage(playerid, 0xAFAFAFAA, "You can't use this command !");
        new playername[MAX_PLAYER_NAME], string[128];
        GetPlayerName(playerid, playername, sizeof(playername));
        format(string, sizeof(string), "* *Groove [%s]: %s,", playername, cmdtext[2]);
        MessageToGroove(playerid, string);
    }
    return 1;
}

// Place this anywhere.
forward MessageToGroove(playerid, const string[]);
public MessageToGroove(playerid, const string[])
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i) && gTeam[i] == TEAM_GROVE) SendClientMessage(i, 0xAFAFAFAA, string);
    }
    return 1;
}
Try this.


Re: [Problme]Team Chat - Hor1z0n - 10.11.2009

i get this error

Код:
D:\DOCUME~1\ADMINI~1\Desktop\MYWORK~1\SAMP03~1\GAMEMO~1\begwar.pwn(1983) : error 029: invalid expression, assumed zero
D:\DOCUME~1\ADMINI~1\Desktop\MYWORK~1\SAMP03~1\GAMEMO~1\begwar.pwn(1983) : warning 215: expression has no effect
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.



Re: [Problme]Team Chat - Hor1z0n - 10.11.2009

i get this error

Код:
D:\DOCUME~1\ADMINI~1\Desktop\MYWORK~1\SAMP03~1\GAMEMO~1\begwar.pwn(1983) : error 029: invalid expression, assumed zero
D:\DOCUME~1\ADMINI~1\Desktop\MYWORK~1\SAMP03~1\GAMEMO~1\begwar.pwn(1983) : warning 215: expression has no effect
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.



Re: [Problme]Team Chat - dice7 - 10.11.2009

(IsPlayerConnected(i) && (gTeam[i] == TEAM_GROVE))


Re: [Problme]Team Chat - Hor1z0n - 10.11.2009

didn't work..:


Re: [Problme]Team Chat - Peter_Corneile - 10.11.2009

Dont add that forward in between the command , add it on the top of script


Re: [Problme]Team Chat - Hor1z0n - 10.11.2009

i added it on the top but still didn't work