[PEDIDO] Chat de Gang.
#21

Quote:
Originally Posted by steeldark
View Post
Se voce define as suas orgs atraves de uma pInfo poderia usar assim:
pawn Code:
public OnPlayerText(playerid,text[])
{
    if(strfind(text,"!",true) == 0)
    {
        for(new p; p<MAX_PLAYERS; p++)
        {
             new msg[128],nome[30],ftext[100];GetPlayerName(playerid,nome,30);
             strmid(ftext,text,1,strlen(text));
             format(msg,128,"(TEAM-CHAT): %s: %s",nome,ftext);
             if(PlayerInfo[playerid][pTeam] == PlayerInfo[p][pTeam]) // troque o pteam pela sua variavel que define as orgs
             {
                  SendClientMessage(p,-1,msg);
             }
        }
    }
}
isso verifica se Tean, de player(quem digito o cmd) com a Team de P (quem recebe a msg) se forem iguais ele envia a msg se nгo continua o loop.
vai depender da sua variavel Team, ou Org (pTeam ou pOrg) em fim.
cara foi isso que eu postei, agora o problema dele й axar qual a variбvel define a gang
Reply
#22

so faltou o cod do [/pawn.. ali na linha...
Reply
#23

Verdade, sorry por ter postado igual. nгo foi inteзгo.

mais caso a variavel dele fosse pelo "PlayerInfo[playerid][pTeam]" ja taria pronto hehe

@topic
qundo vc vai checar em algum comando que й de alguma org vc usa qual varivel?
talvez fique mais facil de achar. ^^
Reply
#24

Quote:
Originally Posted by steeldark
View Post
Verdade, sorry por ter postado igual. nгo foi inteзгo.

mais caso a variavel dele fosse pelo "PlayerInfo[playerid][pTeam]" ja taria pronto hehe

@topic
qundo vc vai checar em algum comando que й de alguma org vc usa qual varivel?
talvez fique mais facil de achar. ^^
sim isso, agora se vocк achasse algum comando estilo dargang ou convidar seria ъtil.
Reply
#25

entao vcs querem que eu poste aqui as new's das gangs ?
Reply
#26

Quote:
Originally Posted by Gustavo_z
View Post
entao vcs querem que eu poste aqui as new's das gangs ?
nгo, posta um comando, /dar lider ou /darorg, ou /setlider ou quem sabe toda sua public de comands q agente da um jeito se tiver algum comando relacionado a orgs lб claro ^^ hehe

mais talvez as news das orgs tbm ajudem, ou ainda quem sabe se vc usar o seu enum pinfo.
Reply
#27

Aqui estгo as new's:

pawn Code:
new Bozo;
new Boyzinhos;
new Gate;
new Militares;
new Chineses;
new Frangos;
new Agentes;
new Noias;
new Gangsters;
new Girls;
new Grovers;
new Ballas;
new LosVagos;
new Mafiosos;
new Mendigos;
new Medicos;
new Manobristas;
new Playboys;
new Surfistas;
new Hitmans;
new Caipiras;
Reply
#28

Vocк nгo tem nenhum comando, dos que eu sitei acima nгo? ou algum comando relacionado a gangs que vc use?
tipo sei lб, /promover [id] [gangue]

pq pelas vars ai, acho q nгo vai ajudar. hehe
Reply
#29

Eu tenho esse GameMode, a variavel dele й a
PHP Code:
static gTeam[MAX_PLAYERS]; 
Se ele nгo tiver editado, irб dar certo

Faзa o seguinte Gustavo.
PHP Code:
public OnPlayerText(playerid,text[])
{
    if(
strfind(text,"!",true) == 0)
    {
        for(new 
pp<MAX_PLAYERSp++)
        {
             new 
msg[128],nome[30],ftext[100];GetPlayerName(playerid,nome,30);
             
strmid(ftext,text,1,strlen(text));
             
format(msg,128,"(TEAM-CHAT): %s: %s",nome,ftext);
             if(
gTeam[playerid] == gTeam[p])
             {
                  
SendClientMessage(p,-1,msg);
             }
        }
    }

Ou tenta assim
PHP Code:
public OnPlayerText(playeridtext[])
{
  if(
text[0] == '!')
    {
        new 
string[256];
        new 
pName[24];
    
GetPlayerName(playerid,pName,sizeof(pName));
      
format(stringsizeof(string), "(TEAM-CHAT): %s: %s"pNametext[1]);
      for(new 
ii<MAX_PLAYERSi++)
      {
        if(
IsPlayerConnected(i) && gTeam[i] == gTeam[playerid] )
        {
          
SendClientMessage(i,COLOR_YELLOWstring);
        }
      }
     }
     return 
1;

Reply
#30

Certo, Deagle sу edita ali em cima nessa parte

pawn Code:
if(PlayerInfo[playerid][gTeam] == PlayerInfo[p][gTeam])
para

pawn Code:
if(gTeam[playerid] == gTeam[p])
pq se a var dele for essa, daria erro no primeiro por nгo existir PlayerInfo[p][gTeam].
Reply
#31

Quote:
Originally Posted by xDarkRed
View Post
pawn Code:
forward OnPlayerGangText(playerid,text[]);
public OnPlayerGangText(playerid,text[])
{
    for (new i = 0; i < MAX_PLAYERS; i++) if (IsPlayerConnected(i) && mmgang[i] == mmgang[playerid]) {
        SendClientMessage(i, GetPlayerColor(playerid), text);
    }
    return 0;
}
Essa parte й para colocar no Final do GM ?
Reply
#32

Quote:
Originally Posted by Gustavo_z
View Post
Essa parte й para colocar no Final do GM ?
Sim, й para colocar no final do gm.

se nгo funcionar, e quizer me add no msn, e passar o gm tento arrumar pra vc.
Reply
#33

Deu isso:

pawn Code:
C:\Users\Gustavo\Desktop\GTA\Coisas GM\gamemodes\extreme.pwn(3043) : error 012: invalid function call, not a valid address
C:\Users\Gustavo\Desktop\GTA\Coisas GM\gamemodes\extreme.pwn(3043) : warning 215: expression has no effect
C:\Users\Gustavo\Desktop\GTA\Coisas GM\gamemodes\extreme.pwn(3043) : error 001: expected token: ";", but found ")"
C:\Users\Gustavo\Desktop\GTA\Coisas GM\gamemodes\extreme.pwn(3043) : error 029: invalid expression, assumed zero
C:\Users\Gustavo\Desktop\GTA\Coisas GM\gamemodes\extreme.pwn(3043) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.
Linha 3043:

pawn Code:
format(srvchat, sizeof(srvchat),"~ (Gang Chat) | %s: [ID: %d]:{FF4000} %s", pNames(playerid), playerid, text[1]);
Reply
#34

Posta a linha 3042
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)