[Ajuda] Transformaзгo
#1

Boas malta,eu ja vi em servidores,umas cenas,tipo,faction/organizaзгo de fazer anuncio,so no meu GM,й por bizz,faz-se o anuncio por bizz,e eu queria trocar para faction.
Comando do anuncio
pawn Код:
if(strcmp(cmd, "/anuncio", true) == 0 || strcmp(cmd, "/an", true) == 0)
        {
            if(IsPlayerConnected(playerid))
            {
                if(gPlayerLogged[playerid] == 0)
                {
                    SendClientMessage(playerid, COLOR_DARKRED, "[ERRO:] Nгo estбs logado.");
                    return 1;
                }
                new length = strlen(cmdtext);
                while ((idx < length) && (cmdtext[idx] <= ' '))
                {
                    idx++;
                }
                new offset = idx;
                new result[128];
                while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
                {
                    result[idx - offset] = cmdtext[idx];
                    idx++;
                }
                result[idx - offset] = EOS;
                if(!strlen(result))
                {
                    SendClientMessage(playerid, COLOR_LIGHTORANGE, "[Comando:] (/an)uncio [texto]");
                    return 1;
                }
                for(new i = 0; i < sizeof(Businesses); i++)
                {
                    if (PlayerToPoint(1.0, playerid,Businesses[i][EnterX], Businesses[i][EnterY], Businesses[i][EnterZ]) || PlayerToPoint(25.0, playerid,Businesses[i][ExitX], Businesses[i][ExitY], Businesses[i][ExitZ]))
                    {
                        if(GetPlayerVirtualWorld(playerid) == i)
                        {
                            if(Businesses[i][BizType] == 5)
                            {
                                if(Businesses[i][Products] != 0)
                                {
                                    if ((!adds) && (PlayerInfo[playerid][mstrvbcAdmin] < 1))
                                    {
                                        format(string, sizeof(string), "Aguarda %d segundos para fazeres outro anъncio.",  (addtimer/1000));
                                        SendClientMessage(playerid, COLOR_WHITE, string);
                                        return 1;

                                    }
                                    new payout = idx * 15;
                                    if(GetPlayerEuros(playerid) < payout)
                                    {
                                        SendClientMessage(playerid, COLOR_DARKRED, "[ERRO:]Nгo tens dinheiro suficiente para fazeres publicidade.");
                                        return 1;
                                    }
                                    GivePlayerEuros(playerid, - payout);
                                    Businesses[i][Till] += payout;
                                    Businesses[i][Products] --;
                                    format(string, sizeof(string), "___________________________[Publicidade]___________________________",  Businesses[i][BusinessName]);
                                    SendClientMessageToAll(COLOR_LIGHTGREEN,string);
                                    format(string, sizeof(string), "[Anъncio:] %s",  result);
                                    SendClientMessageToAll(COLOR_WHITE,string);
                                    format(string, sizeof(string), "[Anъncio:] Publicidade por: %s - Nъmero De Telemуvel: %d.",  GetPlayerNameEx(playerid),PlayerInfo[playerid][msPhoneNumber],Businesses[i][BusinessName]);
                                    SendClientMessageToAll(COLOR_WHITE,string);
                                    SendClientMessageToAll(COLOR_LIGHTGREEN,"________________________________________________________________________________________________________________________");
                                    if (PlayerInfo[playerid][mstrvbcAdmin] < 1){SetTimer("AddsOn", addtimer, 0);adds = 0;}
                                    format(string, sizeof(string), " Caracteres contidos: %d - Preзo: %dЂ - Obrigado pelo seu anъncio.", idx,payout,Businesses[i][BusinessName]);
                                    SendClientMessage(playerid,COLOR_WHITE,string);
                                    PlayerActionMessage(playerid,15.0,"Deu algum dinheiro ao jornalista e fez o seu anuncio");
                                    SaveBusinesses();
                                    return 1;
                                }
                                else
                                {
                                    SendClientMessage(playerid, COLOR_WHITE, "O negуcio nгo tem Produtos.");
                                }
                            }
                            else
                            {
                                SendClientMessage(playerid, COLOR_WHITE, "Este negуcio nao й a companhia de Publicidade.");
                            }
                        }
                    }
                    else
                    {
                        SendClientMessage(playerid, COLOR_WHITE, "Nгo te encontras no Negуcio.");
                    }
                }
            }
            return 1;
Como faзo a transformaзгo para faction/organizaзгo? Queria que me explicassem,ou postassem o code pra min aj com a transformaзгo.
Reply
#2

Poste o ID da organizaзгo e o cofreorg.
Reply
#3

o ID da orgnizaзгo й o 3,o type da orgnizaзгo й 4,mas, quй isso da cofreorg?
Reply
#4

Explique um pouco melhor como vocк quer fazer isso?
Reply
#5

O comando acima,й comando de publicidade,mas й de bizz,entrasse na biz/business e depois faz [/an]uncio e o texto do anuncio,e depois,esse anuncio й mostrado para toda a gente,com o numero de telemovel e etc.

So que eu quero,em vez de ser biz,ser factions,esse comando entrasse na faction,por exemplo,chegava um player,entrava dentro do estabelecimento da faction,fizesse o comando /an,e esse dinheiro,da publicidade viesse para a faction.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)