[Ajuda] comando de chat entre membros da org
#1

Ola galera beleza ? estou precisando muito da ajuda de voces , estou com meu chat de org , sendo que ta Bugado , quando eu digito /ga [texto]
aparece assim ex :

Miliciano , Rodrigo_Gomes[6]:Veiculo: 0

de evz aparecer o texto aparece Veiculo: 0 , o que poderia ser isso ?

pawn Код:
CMD:ga(playerid,params[])
{
    new Text[128];
    if(Policial(playerid)) return SendClientMessage(playerid,C_Vermelho,"[ERRO]Policiais usam /r *-*");
    if(ProgressaoInfo[playerid][Org] == 7)
    {
    for(new i=0; i < MAX_PLAYERS; i++)
    {
    if(ProgressaoInfo[i][Org] == 7) return format(Text,128,"Milicianos - %s[%d]:%s",GetPlayerNameEx(playerid),ProgressaoInfo[playerid][Cargo],Texto),SendClientMessage(i,C_PMilitar,Text);
    }
    return 1;
    }
    if(ProgressaoInfo[playerid][Org] == 8)
    {
    for(new i=0; i < MAX_PLAYERS; i++)
    {
    if(ProgressaoInfo[i][Org] == 8) return format(Texto,128,"Taliban - %s[%d]:%s",GetPlayerNameEx(playerid),ProgressaoInfo[playerid][Cargo],Texto),SendClientMessage(i,C_PMilitar,Texto);
    }
    return 1;
    }
    if(ProgressaoInfo[playerid][Org] == 9)
    {
    for(new i=0; i < MAX_PLAYERS; i++)
    {
    if(ProgressaoInfo[i][Org] == 9) return format(Texto,128,"Primeiro Comando - %s[%d]:%s",GetPlayerNameEx(playerid),ProgressaoInfo[playerid][Cargo],Texto),SendClientMessage(i,C_PMilitar,Texto);
    }
    return 1;
    }
    if(ProgressaoInfo[playerid][Org] == 10)
    {
    for(new i=0; i < MAX_PLAYERS; i++)
    {
    if(ProgressaoInfo[i][Org] == 10) return format(Texto,128,"Groove - %s[%d]:%s",GetPlayerNameEx(playerid),ProgressaoInfo[playerid][Cargo],Texto),SendClientMessage(i,C_PMilitar,Texto);
    }
    return 1;
    }
    if(ProgressaoInfo[playerid][Org] == 11)
    {
    for(new i=0; i < MAX_PLAYERS; i++)
    {
    if(ProgressaoInfo[i][Org] == 11) return format(Texto,128,"Ballas - %s[%d]:%s",GetPlayerNameEx(playerid),ProgressaoInfo[playerid][Cargo],Texto),SendClientMessage(i,C_PMilitar,Texto);
    }
    return 1;
    }
    if(ProgressaoInfo[playerid][Org] == 12)
    {
    for(new i=0; i < MAX_PLAYERS; i++)
    {
    if(ProgressaoInfo[i][Org] == 12) return format(Texto,128,"Comando Vermelho - %s[%d]:%s",GetPlayerNameEx(playerid),ProgressaoInfo[playerid][Cargo],Texto),SendClientMessage(i,C_PMilitar,Texto);
    }
    return 1;
    }
    if(ProgressaoInfo[playerid][Org] == 13)
    {
    for(new i=0; i < MAX_PLAYERS; i++)
    {
    if(ProgressaoInfo[i][Org] == 13) return format(Texto,128,"Yakusa - %s[%d]:%s",GetPlayerNameEx(playerid),ProgressaoInfo[playerid][Cargo],Texto),SendClientMessage(i,C_PMilitar,Texto);
    }
    return 1;
    }
    if(ProgressaoInfo[playerid][Org] == 14)
    {
    for(new i=0; i < MAX_PLAYERS; i++)
    {
    if(ProgressaoInfo[i][Org] == 14) return format(Texto,128,"Al-Qaeda - %s[%d]:%s",GetPlayerNameEx(playerid),ProgressaoInfo[playerid][Cargo],Texto),SendClientMessage(i,C_PMilitar,Texto);
    }
    return 1;
    }
    if(ProgressaoInfo[playerid][Org] == 15)
    {
    for(new i=0; i < MAX_PLAYERS; i++)
    {
    if(ProgressaoInfo[i][Org] == 15) return format(Texto,128,"Hitman - %s[%d]:%s",GetPlayerNameEx(playerid),ProgressaoInfo[playerid][Cargo],Texto),SendClientMessage(i,C_PMilitar,Texto);
    }
    return 1;
    }
    if(ProgressaoInfo[playerid][Org] == 16)
    {
    for(new i=0; i < MAX_PLAYERS; i++)
    {
    if(ProgressaoInfo[i][Org] == 16) return format(Texto,128,"A.D.A - %s[%d]:%s",GetPlayerNameEx(playerid),ProgressaoInfo[playerid][Cargo],Texto),SendClientMessage(i,C_PMilitar,Texto);
    }
    return 1;
    }
    if(ProgressaoInfo[playerid][Org] == 17)
    {
    for(new i=0; i < MAX_PLAYERS; i++)
    {
    if(ProgressaoInfo[i][Org] == 17) return format(Texto,128,"Mafia CN - %s[%d]:%s",GetPlayerNameEx(playerid),ProgressaoInfo[playerid][Cargo],Texto),SendClientMessage(i,C_PMilitar,Texto);
    }
    return 1;
    }
    if(ProgressaoInfo[playerid][Org] == 18)
    {
    for(new i=0; i < MAX_PLAYERS; i++)
    {
    if(ProgressaoInfo[i][Org] == 18) return format(Texto,128,"Krasnaya - %s[%d]:%s",GetPlayerNameEx(playerid),ProgressaoInfo[playerid][Cargo],Texto),SendClientMessage(i,C_PMilitar,Texto);
    }
    return 1;
    }
    if(ProgressaoInfo[playerid][Org] == 19)
    {
    for(new i=0; i < MAX_PLAYERS; i++)
    {
    if(ProgressaoInfo[i][Org] == 19) return format(Texto,128,"Mayans - %s[%d]:%s",GetPlayerNameEx(playerid),ProgressaoInfo[playerid][Cargo],Texto),SendClientMessage(i,C_PMilitar,Texto);
    }
    return 1;
    }
    if(ProgressaoInfo[playerid][Org] == 20)
    {
    for(new i=0; i < MAX_PLAYERS; i++)
    {
    if(ProgressaoInfo[i][Org] == 20) return format(Texto,128,"S.O.A - %s[%d]:%s",GetPlayerNameEx(playerid),ProgressaoInfo[playerid][Cargo],Texto),SendClientMessage(i,C_PMilitar,Texto);
    }
    return 1;
    }
    if(ProgressaoInfo[playerid][Org] == 21)
    {
    for(new i=0; i < MAX_PLAYERS; i++)
    {
    if(ProgressaoInfo[i][Org] == 21) return format(Texto,128,"M.S.T - %s[%d]:%s",GetPlayerNameEx(playerid),ProgressaoInfo[playerid][Cargo],Texto),SendClientMessage(i,C_PMilitar,Texto);
    }
    return 1;
    }
    if(ProgressaoInfo[playerid][Org] == 22)
    {
    for(new i=0; i < MAX_PLAYERS; i++)
    {
    if(ProgressaoInfo[i][Org] == 22) return format(Texto,128,"P2 - %s[%d]:%s",GetPlayerNameEx(playerid),ProgressaoInfo[playerid][Cargo],Texto),SendClientMessage(i,C_PMilitar,Texto);
    }
    return 1;
    }
    if(ProgressaoInfo[playerid][Org] == 23)
    {
    for(new i=0; i < MAX_PLAYERS; i++)
    {
    if(ProgressaoInfo[i][Org] == 23) return format(Texto,128,"Terceiro Comando - %s[%d]:%s",GetPlayerNameEx(playerid),ProgressaoInfo[playerid][Cargo],Texto),SendClientMessage(i,C_PMilitar,Texto);
    }
    return 1;
    }
    return 1;
}
e o codigo ontem tem escrito "veiculo: 0" , qu eй o que estar entrando em conflito
pawn Код:
stock CriarVeiculos()
{
    new MAXVEICULOS, Float: Pos[4], cor[2], Modelo;
    INI_Open("NLGArquivos/Organizaзхes/Veiculos/Policia Militar.ini");
    MAXVEICULOS = INI_ReadInt("MAXVEICULOS");
    for(new PP = 0; PP <= MAXVEICULOS; PP++)
    {
        format(Texto, 15, "vaga%dmodelo", PP), Modelo = INI_ReadInt(Texto);
        format(Texto, 15, "vaga%dX", PP), Pos[0] = INI_ReadFloat(Texto);
        format(Texto, 15, "vaga%dY", PP), Pos[1] = INI_ReadFloat(Texto);
        format(Texto, 15, "vaga%dZ", PP), Pos[2] = INI_ReadFloat(Texto);
        format(Texto, 15, "vaga%dA", PP), Pos[3] = INI_ReadFloat(Texto);
        format(Texto, 15, "vaga%dCor1", PP), cor[0] = INI_ReadInt(Texto);
        format(Texto, 15, "vaga%dCor2", PP), cor[1] = INI_ReadInt(Texto);
        VPMilitar[PP] = CreateVehicle(Modelo, Pos[0], Pos[1], Pos[2], Pos[3], cor[0], cor[1], 50000);
        format(Texto, 15, "vaga%dlataria", PP), SetVehicleHealth(VPMilitar[PP], INI_ReadFloat(Texto));
        format(Texto, 12, "Veiculo: %d", PP);
        new Text3D: CarroID = Create3DTextLabel(Texto, C_Verde, Pos[0], Pos[1], Pos[2], 40, 0, 0);
        Attach3DTextLabelToVehicle(CarroID, VPMilitar[PP], 0.0, 0.0, 2.0);
        printf("Veiculos da Policia Militar Carregados com Sucesso");
    }
    INI_Close();
//term varias dessas , sendo que de outras orgs . rs
Reply
#2

pawn Код:
CMD:r(playerid,params[])
{
    new final[128], player[24], cargo[20];
    switch(PlayerInfo[playerid][org])
    {
        case 0: return SendClientMessage(playerid,-1,"Vocк й um civil.");
        case 1: // Cargos da ORG 1
        {
            switch(PlayerInfo[playerid][rank])
            {
                case 1: cargo = "Olheiro";
                case 2: cargo = "Aviгozinho";
                case 3: cargo = "Fogueteiro";
                case 4: cargo = "Soldado";
                case 5,555,444: cargo = "Vapor"
            }
        }
        //case 2: // cargos da org 2....
    }
    GetPlayerName(playerid,player,24);
    format(final,sizeof final,"[RADIO] %s %s: %s",cargo,player,params);
    SendMessageToOrg(PlayerInfo[playerid][org],-1,final);
    return 1;
}

stock SendMessageToOrg(orgid,color,msg[])
{
    for(new om = 0; om < MAX_PLAYERS; om ++)
    {
        if(IsPlayerConnected(om))
        {
            if(PlayerInfo[om][org] == orgid)
            {
                SendClientMessage(om,color,msg);
            }
        }
    }
}
kbei de fazer... nem testei :P
Reply
#3

Valeu man ! deu certo aqui . troquei uams variaveis , e deu certinho ! vlw .
Mas me diga ,
pawn Код:
porque case 5,[COLOR="Red"]555,444[/COLOR]: cargo = "Vapor"
sу pra tira ruma duvida , rs pois coloquei uam case 6, dai sei la se precisa colocar isso tmabem ..

555,444
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)