SA-MP Forums Archive
[AJUDA] Nao consigo integrar uma FS na GM - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [AJUDA] Nao consigo integrar uma FS na GM (/showthread.php?tid=299200)



[AJUDA] Nao consigo integrar uma FS na GM - marcelodell - 24.11.2011

Boa tarde galera, eu estava criando um sistema de neon (NA VERDADE EU EDITEI, ENCONTREI UMA AQUI NO FORUM QUE ESTAVA BUGADA E CONSEGUI DESBUGAR E APERFEIЗOAR DO JEITO QUE EU QUERIA), depois de ter testado tudo, tentei adicionar na minha GM, mas toda vez que eu compilo da erro. Da algum erro diferente, eu coloco os codigos da seguinte maneira:

Isso eu coloco na Public OnPlayerCommandText:

pawn Код:
if (strcmp(cmdtext, "/neon", true)==0)
        {
         if(IsPlayerInRangeOfPoint(playerid, 3.0, 1071.3988,-1772.4235,14.9063)||IsPlayerInRangeOfPoint(playerid, 3.0,1063.1541,-1772.4834,14.9068))
        {
        if(GetPlayerState(playerid) != 2) return SendClientMessage(playerid, 0x00FF00AA, "Vocк nгo esta em nenhum veiculo!");
        new veiculo = GetVehicleModel(GetPlayerVehicleID(playerid));
        if(Moto(veiculo)) return SendClientMessage(playerid, 0x00FF00AA, "Vocк nгo pode colocar neon em uma Moto ou Bicicleta!.");
        ShowPlayerDialog(playerid, 8899, DIALOG_STYLE_LIST, "Escolha a cor do Neon", "Azul R$ 500,00\nVermelho R$ 500,00\nVerde R$ 500,00\nBranco R$ 500,00\nPink R$ 500,00\nAmarelo R$ 500,00\nPolice Strobe R$ 1000,00\nLuzes de Interior R$ 1000,00\nBack Neon R$ 500,00\nFront neon R$ 500,00\nSirene R$ 200,00\nRemover todo o sistema de Neon", "Selecionar", "Cancelar");
        PlayerPlaySound(playerid, 1133, 0.0, 0.0, 10.0);
        }
        return 1;
        }
E coloco isso na public OnDialogResponse:

pawn Код:
if(dialogid == 8899)
        {
                if(response)
                {
                        if(listitem == 0)
                        {


                        //blue
                        if(GetPlayerMoney(playerid) < 500) return SendClientMessage(playerid, 0xFFFFFFAA, "Vocк nгo dinheiro suficiente.");
                        SetPVarInt(playerid, "Status", 1);
                        SetPVarInt(playerid, "neon", CreateObject(18648,0,0,0,0,0,0));
                        SetPVarInt(playerid, "neon1", CreateObject(18648,0,0,0,0,0,0));
                        AttachObjectToVehicle(GetPVarInt(playerid, "neon"), GetPlayerVehicleID(playerid), -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
                        AttachObjectToVehicle(GetPVarInt(playerid, "neon1"), GetPlayerVehicleID(playerid), 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
                        GivePlayerMoney(playerid, -500);
                        SendClientMessage(playerid,0x0000FFAA, "Neon instalado, vocк pagou R$ 500,00!");
                        }
                        if(listitem == 1)
                        {


                         //red
                         if(GetPlayerMoney(playerid) < 500) return SendClientMessage(playerid, 0xFFFFFFAA, "Vocк nгo dinheiro suficiente.");
                        SetPVarInt(playerid, "Status", 1);
                        SetPVarInt(playerid, "neon2", CreateObject(18647,0,0,0,0,0,0));
                        SetPVarInt(playerid, "neon3", CreateObject(18647,0,0,0,0,0,0));
                        AttachObjectToVehicle(GetPVarInt(playerid, "neon2"), GetPlayerVehicleID(playerid), -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
                        AttachObjectToVehicle(GetPVarInt(playerid, "neon3"), GetPlayerVehicleID(playerid), 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
                        SendClientMessage(playerid,0xFF0000AA, "Neon instalado, vocк pagou R$ 500,00!");
                        GivePlayerMoney(playerid, -500);

                        }
                        if(listitem == 2)
                        {


                        //green
                        if(GetPlayerMoney(playerid) < 500) return SendClientMessage(playerid, 0xFFFFFFAA, "Vocк nгo dinheiro suficiente.");
                        SetPVarInt(playerid, "Status", 1);
                        SetPVarInt(playerid, "neon4", CreateObject(18649,0,0,0,0,0,0));
                        SetPVarInt(playerid, "neon5", CreateObject(18649,0,0,0,0,0,0));
                        AttachObjectToVehicle(GetPVarInt(playerid, "neon4"), GetPlayerVehicleID(playerid), -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
                        AttachObjectToVehicle(GetPVarInt(playerid, "neon5"), GetPlayerVehicleID(playerid), 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
                        SendClientMessage(playerid,0x00FF00AA, "Neon instalado, vocк pagou R$ 500,00!");
                        GivePlayerMoney(playerid, -500);

                        }
                        if(listitem == 3)
                        {

                        //white
                        if(GetPlayerMoney(playerid) < 500) return SendClientMessage(playerid, 0xFFFFFFAA, "Vocк nгo dinheiro suficiente.");
                        SetPVarInt(playerid, "Status", 1);
                        SetPVarInt(playerid, "neon6", CreateObject(18652,0,0,0,0,0,0));
                        SetPVarInt(playerid, "neon7", CreateObject(18652,0,0,0,0,0,0));
                        AttachObjectToVehicle(GetPVarInt(playerid, "neon6"), GetPlayerVehicleID(playerid), -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
                        AttachObjectToVehicle(GetPVarInt(playerid, "neon7"), GetPlayerVehicleID(playerid), 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
                        SendClientMessage(playerid,0xFFFFFFAA, "Neon instalado, vocк pagou R$ 500,00!");
                        GivePlayerMoney(playerid, -500);

                        }
                        if(listitem == 4)
                        {


                        //pink
                        if(GetPlayerMoney(playerid) < 500) return SendClientMessage(playerid, 0xFFFFFFAA, "Vocк nгo dinheiro suficiente.");
                        SetPVarInt(playerid, "Status", 1);
                        SetPVarInt(playerid, "neon8", CreateObject(18651,0,0,0,0,0,0));
                        SetPVarInt(playerid, "neon9", CreateObject(18651,0,0,0,0,0,0));
                        AttachObjectToVehicle(GetPVarInt(playerid, "neon8"), GetPlayerVehicleID(playerid), -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
                        AttachObjectToVehicle(GetPVarInt(playerid, "neon9"), GetPlayerVehicleID(playerid), 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
                        SendClientMessage(playerid,0xFF00FFAA, "Neon instalado, vocк pagou R$ 500,00!");
                        GivePlayerMoney(playerid, -500);

                        }
                        if(listitem == 5)
                        {


                        //yellow
                        if(GetPlayerMoney(playerid) < 500) return SendClientMessage(playerid, 0xFFFFFFAA, "Vocк nгo dinheiro suficiente.");
                        SetPVarInt(playerid, "Status", 1);
                        SetPVarInt(playerid, "neon10", CreateObject(18650,0,0,0,0,0,0));
                        SetPVarInt(playerid, "neon11", CreateObject(18650,0,0,0,0,0,0));
                        AttachObjectToVehicle(GetPVarInt(playerid, "neon10"), GetPlayerVehicleID(playerid), -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
                        AttachObjectToVehicle(GetPVarInt(playerid, "neon11"), GetPlayerVehicleID(playerid), 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
                        SendClientMessage(playerid,0xFFFF00AA, "Neon instalado, vocк pagou R$ 500,00!");
                        GivePlayerMoney(playerid, -500);

}
                        if(listitem == 6)
                        {


                        //police
                        if(GetPlayerMoney(playerid) < 1000) return SendClientMessage(playerid, 0xFFFFFFAA, "Vocк nгo dinheiro suficiente.");
                        SetPVarInt(playerid, "Status", 1);
                        SetPVarInt(playerid, "neon12", CreateObject(18646,0,0,0,0,0,0));
                        SetPVarInt(playerid, "neon13", CreateObject(18646,0,0,0,0,0,0));
                        AttachObjectToVehicle(GetPVarInt(playerid, "neon12"), GetPlayerVehicleID(playerid), -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
                        AttachObjectToVehicle(GetPVarInt(playerid, "neon13"), GetPlayerVehicleID(playerid), 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
                        SendClientMessage(playerid,0x0000FFAA, "Police Strobe instalado, vocк pagou R$ 1000,00!");
                        GivePlayerMoney(playerid, -1000);

                        }

                        if(listitem == 7)
                        {
                        if(GetPlayerMoney(playerid) < 1000) return SendClientMessage(playerid, 0xFFFFFFAA, "Vocк nгo dinheiro suficiente.");
                        SetPVarInt(playerid, "Status", 1);
                        SetPVarInt(playerid, "interior", CreateObject(18646,0,0,0,0,0,0));
                        SetPVarInt(playerid, "interior1", CreateObject(18646,0,0,0,0,0,0));
                        AttachObjectToVehicle(GetPVarInt(playerid, "interior"), GetPlayerVehicleID(playerid), 0, -0.0, 0, 2.0, 2.0, 3.0);
                        AttachObjectToVehicle(GetPVarInt(playerid, "interior1"), GetPlayerVehicleID(playerid), 0, -0.0, 0, 2.0, 2.0, 3.0);
                        SendClientMessage(playerid,0x0000FFAA, "Luzes de Interior instaladas, vocк pagou R$ 1000,00!");
                        GivePlayerMoney(playerid, -1000);

                        }
                        if(listitem == 8)
                        {

                        //back
                        if(GetPlayerMoney(playerid) < 500) return SendClientMessage(playerid, 0xFFFFFFAA, "Vocк nгo dinheiro suficiente.");
                        SetPVarInt(playerid, "Status", 1);
                        SetPVarInt(playerid, "back", CreateObject(18646,0,0,0,0,0,0));
                        SetPVarInt(playerid, "back1", CreateObject(18646,0,0,0,0,0,0));
                        AttachObjectToVehicle(GetPVarInt(playerid, "back"), GetPlayerVehicleID(playerid), -0.0, -1.5, -1, 2.0, 2.0, 3.0);
                        AttachObjectToVehicle(GetPVarInt(playerid, "back1"), GetPlayerVehicleID(playerid), -0.0, -1.5, -1, 2.0, 2.0, 3.0);
                        SendClientMessage(playerid,0x0000FFAA, "Back Neon instalado, vocк pagou R$ 500,00!");
                        GivePlayerMoney(playerid, -500);
                        }
                        if(listitem == 9)
                        {

                                //front
                        if(GetPlayerMoney(playerid) < 500) return SendClientMessage(playerid, 0xFFFFFFAA, "Vocк nгo dinheiro suficiente.");
                        SetPVarInt(playerid, "Status", 1);
                        SetPVarInt(playerid, "front", CreateObject(18646,0,0,0,0,0,0));
                        SetPVarInt(playerid, "front1", CreateObject(18646,0,0,0,0,0,0));
                        AttachObjectToVehicle(GetPVarInt(playerid, "front"), GetPlayerVehicleID(playerid), -0.0, 1.5, -0.6, 2.0, 2.0, 3.0);
                        AttachObjectToVehicle(GetPVarInt(playerid, "front1"), GetPlayerVehicleID(playerid), -0.0, 1.5, -0.6, 2.0, 2.0, 3.0);
                        SendClientMessage(playerid,0x0000FFAA, "Front Neon instalado, vocк pagou R$ 500,00!");
                        GivePlayerMoney(playerid, -500);
                        }
                        if(listitem == 10)
                                {
                        //undercover
                        if(GetPlayerMoney(playerid) < 200) return SendClientMessage(playerid, 0xFFFFFFAA, "Vocк nгo dinheiro suficiente.");
                        SetPVarInt(playerid, "Status", 1);
                        SetPVarInt(playerid, "undercover", CreateObject(18646,0,0,0,0,0,0));
                        SetPVarInt(playerid, "undercover1", CreateObject(18646,0,0,0,0,0,0));
                        AttachObjectToVehicle(GetPVarInt(playerid, "undercover"), GetPlayerVehicleID(playerid), -0.5, -0.2, 0.8, 2.0, 2.0, 3.0);
                        AttachObjectToVehicle(GetPVarInt(playerid, "undercover1"), GetPlayerVehicleID(playerid), -0.5, -0.2, 0.8, 2.0, 2.0, 3.0);
                        SendClientMessage(playerid,0x0000FFAA, "Undecover Lights instalado, vocк pagou R$ 200,00!");
                        GivePlayerMoney(playerid, -200);
                        }
                        if(listitem == 11)
                        {
                        //remove neon
                        DestroyObject(GetPVarInt(playerid, "neon"));
                        DeletePVar(playerid, "Status");
                        DestroyObject(GetPVarInt(playerid, "neon1"));
                        DeletePVar(playerid, "Status");
                        DestroyObject(GetPVarInt(playerid, "neon2"));
                        DeletePVar(playerid, "Status");
                        DestroyObject(GetPVarInt(playerid, "neon3"));
                        DeletePVar(playerid, "Status");
                        DestroyObject(GetPVarInt(playerid, "neon4"));
                        DeletePVar(playerid, "Status");
                        DestroyObject(GetPVarInt(playerid, "neon5"));
                        DeletePVar(playerid, "Status");
                        DestroyObject(GetPVarInt(playerid, "neon6"));
                        DeletePVar(playerid, "Status");
                        DestroyObject(GetPVarInt(playerid, "neon7"));
                        DeletePVar(playerid, "Status");
                        DestroyObject(GetPVarInt(playerid, "neon8"));
                        DeletePVar(playerid, "Status");
                        DestroyObject(GetPVarInt(playerid, "neon9"));
                        DeletePVar(playerid, "Status");
                        DestroyObject(GetPVarInt(playerid, "neon10"));
                        DeletePVar(playerid, "Status");
                        DestroyObject(GetPVarInt(playerid, "neon11"));
                        DeletePVar(playerid, "Status");
                        DestroyObject(GetPVarInt(playerid, "neon12"));
                        DeletePVar(playerid, "Status");
                        DestroyObject(GetPVarInt(playerid, "neon13"));
                        DeletePVar(playerid, "Status");
                        DestroyObject(GetPVarInt(playerid, "interior"));
                        DeletePVar(playerid, "Status");
                        DestroyObject(GetPVarInt(playerid, "interior1"));
                        DeletePVar(playerid, "Status");
                        DestroyObject(GetPVarInt(playerid, "back"));
                        DeletePVar(playerid, "Status");
                        DestroyObject(GetPVarInt(playerid, "back1"));
                        DeletePVar(playerid, "Status");
                        DestroyObject(GetPVarInt(playerid, "front"));
                        DeletePVar(playerid, "Status");
                        DestroyObject(GetPVarInt(playerid, "front1"));
                        DeletePVar(playerid, "Status");
                        DestroyObject(GetPVarInt(playerid, "undercover"));
                        DeletePVar(playerid, "Status");
                        DestroyObject(GetPVarInt(playerid, "undercover1"));

                        DeletePVar(playerid, "Status");
                        SendClientMessage(playerid,0xFFFFFFAA, "Todos os Neon foram removidos!");


                      }
                 }
                 }
Mas eu tenho uma certeza, os erros da pq eu nao sei aonde coloca essa Stock:

pawn Код:
stock Moto(veiculo)
{
    if(veiculo == 448 || veiculo == 461 || veiculo == 462 || veiculo == 463 || veiculo == 468 || veiculo == 521 || veiculo == 522 || veiculo == 523 || veiculo == 581 || veiculo == 586 || veiculo == 481 || veiculo == 509 || veiculo == 510)
    {
        return 1;
    }
    return 0;
}
Entao alguem poderia me dizer aonde eu coloco essa stock?


Re: [AJUDA] Nao consigo integrar uma FS na GM - Kuddy - 24.11.2011

Se vc postasse os erros ficava mais facil neh xD


Re: [AJUDA] Nao consigo integrar uma FS na GM - Cristhian - 24.11.2011

coloque a stock no final do gm, no final de tudo..


Re: [AJUDA] Nao consigo integrar uma FS na GM - marcelodell - 24.11.2011

Ai da essa warning:

pawn Код:
warning 204: symbol is assigned a value that is never used: "veiculo"
Nessa linha:

pawn Код:
new veiculo = GetVehicleModel(GetPlayerVehicleID(playerid));
OBS: No FS n estava dando nenhum Warning :P


Re: [AJUDA] Nao consigo integrar uma FS na GM - Cristhian - 24.11.2011

isso й de algum comando? se for podes mandar o comando inteiro ?


Re: [AJUDA] Nao consigo integrar uma FS na GM - marcelodell - 24.11.2011

Sim, e do /neon q eu ja havia mandando no primeiro post. Aqui esta ele:

pawn Код:
if (strcmp(cmdtext, "/neon", true)==0)
        {
         if(IsPlayerInRangeOfPoint(playerid, 3.0, 1071.3988,-1772.4235,14.9063)||IsPlayerInRangeOfPoint(playerid, 3.0,1063.1541,-1772.4834,14.9068))
        {
        if(GetPlayerState(playerid) != 2) return SendClientMessage(playerid, 0x00FF00AA, "Vocк nгo esta em nenhum veiculo!");
        new veiculo = GetVehicleModel(GetPlayerVehicleID(playerid)); //O WARNING E NESTA LINHA
        if(Moto(veiculo)) return SendClientMessage(playerid, 0x00FF00AA, "Vocк nгo pode colocar neon em uma Moto ou Bicicleta!.");
        ShowPlayerDialog(playerid, 8899, DIALOG_STYLE_LIST, "Escolha a cor do Neon", "Azul R$ 500,00\nVermelho R$ 500,00\nVerde R$ 500,00\nBranco R$ 500,00\nPink R$ 500,00\nAmarelo R$ 500,00\nPolice Strobe R$ 1000,00\nLuzes de Interior R$ 1000,00\nBack Neon R$ 500,00\nFront neon R$ 500,00\nSirene R$ 200,00\nRemover todo o sistema de Neon", "Selecionar", "Cancelar");
        PlayerPlaySound(playerid, 1133, 0.0, 0.0, 10.0);
        }
        return 1;
        }



Re: [AJUDA] Nao consigo integrar uma FS na GM - !Niiw - 24.11.2011

vocк jб colocou a stock no final do game mode?

aqui eu testei e tб funcionando perfeitamente


Re: [AJUDA] Nao consigo integrar uma FS na GM - CaioMors - 24.11.2011

Coloque a stock, no Final do Gamemode, que da certo colega.


Re: [AJUDA] Nao consigo integrar uma FS na GM - marcelodell - 24.11.2011

Coloquei sim

@EDIT

COnsegui resolver o problema pessoal, havia colocado uma } a mais, vlw pela ajuda.