12.12.2010, 15:03
I'm trying to make a code, for group chat, for everyone. And it gets the team of the player who typed, and send for all other players of his team (1 command for any teams), but that crashs, and I've tried always
DCMD + SSCANF
pawn Код:
dcmd_c(playerid,params[])
{
new string[128];
new name[30]; GetPlayerName(playerid, name, 30);
if(sscanf(params, "s[128]", params[2])) return SendClientMessage(playerid, cinza, "/c <texto>");
format(string,sizeof(string),"%s [ID:%d]: %s",name,playerid,params[2]);
foreach (Player, i)
{
if(GetPlayerTeam(playerid) == GetPlayerTeam(i))
{
SendClientMessage(i, agua, string);
}
}
return 1;
}