[Problme]Team Chat
#1

Код:
	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
Reply
#2

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

this didn't work 100%
now appears something like this
Reply
#4

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.
Reply
#5

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.
Reply
#6

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.
Reply
#7

(IsPlayerConnected(i) && (gTeam[i] == TEAM_GROVE))
Reply
#8

didn't work..:
Reply
#9

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

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


Forum Jump:


Users browsing this thread: 2 Guest(s)