Eu tenho um fs de gang do sub-zer00 й quando alguem fala no chat com tipo umas 90 linha ou mais o servidor desliga alguйm me ajuda :/
Й tambйm que ele tocasse som quando alguem falasse sу consegui colocar pra dono nivйl 5 da gang
Код:
public OnPlayerText(playerid, text[])
{
if(text[0]=='KRL'&&GangID[playerid]!=0)
{
new fm[128],fm2[128],resto[128];
if(GangLevel[playerid]>3&&text[1]=='KRL')
{
new nml[MAX_PLAYER_NAME];
GetPlayerName(playerid,nml,sizeof(nml));
strmid(resto,text,2,strlen(text),128);
if(GangLevel[playerid]==5)
{
format(fm,140,"~b~%s:~w~ %s",POS_NV5,resto);
format(fm2,140,"{FFFF00}[GANG CHAT] {00FFFF}%s %s:{FFFFFF} %s",POS_NV5,nml,resto);
PlayerPlaySound(1,1056,0.0,0.0,0.0);
}
else
{
format(fm,90,"~b~%s: %s",POS_NV4,resto);
format(fm2,140,"{FFFF00}[GANG CHAT] {00FFFF}%s %s:{FFFFFF} %s",POS_NV4,nml,resto);
PlayerPlaySound(1,1056,0.0,0.0,0.0);
}
for(new i=0;i<MAX_PLAYERS;i++)
if(IsPlayerConnected(i))
if(GangID[playerid]==GangID[i])
{
GameTextForPlayer(i,fm,5000,3);
SendClientMessage(i,azul,fm2);
}
return 0;
}
strmid(resto,text,1,strlen(text),140);
new name[MAX_PLAYER_NAME];GetPlayerName(playerid,name,sizeof(name));
switch(GangLevel[playerid])
{
case 0:
format(fm,140,"{FFFF00}[GANG CHAT] {00FFFF}%s %s:{FFFFFF} %s",POS_NV0,name,resto);
case 1:
format(fm,140,"{FFFF00}[GANG CHAT] {00FFFF}%s %s:{FFFFFF} %s",POS_NV1,name,resto);
case 2:
format(fm,140,"{FFFF00}[GANG CHAT] {00FFFF}%s %s:{FFFFFF} %s",POS_NV2,name,resto);
case 3:
format(fm,140,"{FFFF00}[GANG CHAT] {00FFFF}%s %s:{FFFFFF} %s",POS_NV3,name,resto);
case 4:
format(fm,140,"{FFFF00}[GANG CHAT] {00FFFF}%s %s:{FFFFFF} %s",POS_NV4,name,resto);
case 5:
format(fm,140,"{FFFF00}[GANG CHAT] {00FFFF}%s %s:{FFFFFF} %s",POS_NV5,name,resto);
}
for(new i=0;i<MAX_PLAYERS;i++)
if(IsPlayerConnected(i))
if(GangID[playerid]==GangID[i])
SendClientMessage(i,azul,fm);
return 0;
}
return 0;
}
Код:
new sendername[30];
GetPlayerName(playerid, sendername, sizeof(sendername));
new string[300];
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "{FFA500}[Chat teste] %s (%i): {FFA500}%s", sendername, playerid , text[1]);
for(new i = 0; i < MAX_PLAYERS; i ++)
{
if(IsPlayerConnected(i))//IsPlayerConnected(i)
{
if(PlayerInfo[i][pSUAGANG] >= 1) //SUA GANG DO SEU GM
{
SendClientMessage( i, 0xFFFF000, string );
}
}
}
printf(string);
return 0;
}