SA-MP Forums Archive
Help with a really big bug?? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Help with a really big bug?? (/showthread.php?tid=645480)



Help with a really big bug?? - AmarPlayer - 27.11.2017

Hi, I created a small roleplay gamemode, just to test things out and stuff, and when I compile it I don't get any errors or warnings, but, for example, I set up a welcome message so when you connect to the server you get a message like this: "Welcome to the server!", but the problem is that everyone else on the server gets it, and it's the same thing with dialogs, when I should get a dialog displayed everyone else gets it.

I hope you understand.
If any blocks of code are needed just tell me.


Re: Help with a really big bug?? - Riddick94 - 27.11.2017

There's a loop in the OnPlayerConnect callback with the server message to the client inside it.


Re: Help with a really big bug?? - AmarPlayer - 27.11.2017

Any more help? I don't really understand what are you trying to say.


Re: Help with a really big bug?? - Riddick94 - 28.11.2017

Paste your OnPlayerConnect.


Re: Help with a really big bug?? - Sithis - 28.11.2017

If you want help, show your code. We shouldn’t even have to ask for it.


Re: Help with a really big bug?? - AmarPlayer - 12.03.2018

I completely forgot about this thread, so I'm bringing it back.
Quote:

We shouldn’t even have to ask for it.

How am I supposed to know what you need before even asking? Anyways, here it is:
PHP код:
public OnPlayerConnect(playerid)
{
    
AdminDuznost[playerid] = 0;
    
PosaoVMZagreb[playerid] = 0;
    
Jetpack[playerid] = 0;
    
Oprema[playerid] = 0;
    
KupujeDrogu[playerid] = 0;
    
KoristiDrogu[playerid] = 0;
    
Logovan[playerid] = 0;


    new 
string[200];
    new 
namestring strfind(ImeIgraca(playerid), "_"true);
    if(
namestring == -&& PlayerInfo[playerid][pAdmin] != 6)
    {
        
SCM"[ E ] | {FFFFFF}Kikovani ste sa servera zbog NON-RP imena. Ime mora biti u formatu Ime_Prezime, naprimjer Marko_Markovic.");
        
format(stringsizeof(string),"[ E ] | {FFFFFF}Igrac %s nije koristio RP ime i zbog toga je kikovan sa servera."ImeIgraca(playerid));
        
SCMTA(ZUTAstring);
        
SetTimerEx("ImeKick"500false"i"playerid);
        return 
1;
    }

    
RemoveBuildingForPlayer(playerid12611408.6563, -1407.171928.62500.25);
    
RemoveBuildingForPlayer(playerid42391407.9063, -1407.398433.98440.25);
    
RemoveBuildingForPlayer(playerid12671408.6563, -1407.171928.62500.25);
    
RemoveBuildingForPlayer(playerid47571404.1406, -1309.132843.28910.25);
    
RemoveBuildingForPlayer(playerid12661371.4688, -1268.218837.33590.25);
    
RemoveBuildingForPlayer(playerid47361404.1406, -1309.132843.28910.25);
    
RemoveBuildingForPlayer(playerid12601371.4688, -1268.218837.33590.25);
    
RemoveBuildingForPlayer(playerid45881405.8750, -1254.789134.00000.25);
    
RemoveBuildingForPlayer(playerid6911144.0781, -2076.375068.10160.25);
    
RemoveBuildingForPlayer(playerid12261137.5078, -2070.031371.78130.25);
    
RemoveBuildingForPlayer(playerid12261138.4375, -2003.914171.78130.25);
    
RemoveBuildingForPlayer(playerid6911208.6484, -2000.070367.39060.25);
    
RemoveBuildingForPlayer(playerid6911205.2734, -1987.820363.78910.25);
    
RemoveBuildingForPlayer(playerid13881238.3750, -1258.281357.20310.25);
    
RemoveBuildingForPlayer(playerid13911238.3750, -1258.273444.66410.25);
    
SetPlayerColor(playerid, -1);
    
SetTimer("KonektPoruke"1000false);
    return 
1;




Re: Help with a really big bug?? - Sew_Sumi - 12.03.2018

Код:
SCM, "[ E ] | {FFFFFF}Kikovani ste sa servera zbog NON-RP imena. Ime mora biti u formatu Ime_Prezime, naprimjer Marko_Markovic.");
That should be giving you an error in the first instance, but also this code doesn't appear to be what's causing it.

Where's the dialog 'shown' that everyone is seeing, in the script. That's what you should show.


Re: Help with a really big bug?? - AmarPlayer - 12.03.2018

It happens with all of them, here is this one for example:
CMD:donacije(playerid, params[], help)
PHP код:
{
    
JeliLogovan
    SPD
(playeridDIALOG_DONACIJEDIALOG_STYLE_LIST"{FFDF2D}Donacije servera:""{FFFFFF}Level\nNovac\nImanje\nOrganizacija\nNick\n{FFDF2D}POMOC""{ffdf2d}Izaberi""{ffdf2d}Zatvori");
    return 
1;

And here it is in OnDialogResponse:
PHP код:
        case DIALOG_DONACIJE:
        {
            if(
response)
            {
                switch(
listitem)
                {
                    case 
0:
                    {
                        
SPD(playeridDIALOG_DLEVELDIALOG_STYLE_MSGBOX"{FFDF2D}Donacije - Level""{ffd2fd}|     LEVEL     |\n{FFFFFF}Cijena: {ffdf2d}1 Level = 0.50 KM""{ffdf2d}Zatvori""");
                    }
                    case 
1:
                    {
                        
SPD(playeridDIALOG_DNOVACDIALOG_STYLE_MSGBOX"{FFDF2D}Donacije - Novac""{ffdf2d}|     NOVAC     |\n{ffffff}Cijena: {ffdf2d}$100.000 = 1 KM""{ffdf2d}Zatvori""");
                    }
                    case 
2:
                    {
                        
SPD(playeridDIALOG_DIMANJEDIALOG_STYLE_MSGBOX"{FFDF2D}Donacije - Privatno imanje""{ffdf2d}|     PRIVATNO IMANJE     |\n{ffdf2d}|     (mapano)     |\n{ffffff}Cijena: 2 KM (+ vase ime napisano na znaku)""{ffdf2d}Zatvori""");
                    }
                    case 
3:
                    {

                    }
                    case 
4:
                    {
                        
SPD(playeridDIALOG_DNICKDIALOG_STYLE_MSGBOX"{FFDF2D}Donacije - Specijalan nick""{ffdf2d}|    SPECIJALAN NICK     |\n{ffffff}Cijena: {ffdf2d}1.50 KM""{FFDF2D}Zatvori""");
                    }
                    case 
5:
                    {
                        
SPD(playeridDIALOG_DPOMOCDIALOG_STYLE_MSGBOX"{FFDF2D}Donacije - Pomoc""{ffdf2d}|     POMOC     |\n{FFFFFF}Napisite poruku na ******** profil 'Elliot Alderson' sa porukom '{ffdf2d}DONACIJA'""{ffdf2d}Zatvori""");
                    }
                }
            }
            return 
1;
        } 



Re: Help with a really big bug?? - Sew_Sumi - 12.03.2018

Then show your SCM/SPD defines, as it's highly likely that that is what's wrong.


Re: Help with a really big bug?? - Sithis - 13.03.2018

Quote:
Originally Posted by AmarPlayer
Посмотреть сообщение
How am I supposed to know what you need before even asking?
Quote:
Originally Posted by AmarPlayer
Посмотреть сообщение
Hi, I created a small roleplay gamemode, just to test things out and stuff, and when I compile it I don't get any errors or warnings, but, for example, I set up a welcome message so when you connect to the server you get a message like this: "Welcome to the server!", but the problem is that everyone else on the server gets it, and it's the same thing with dialogs, when I should get a dialog displayed everyone else gets it.

I hope you understand.
If any blocks of code are needed just tell me.
If you are able to read, you can answer your own question.