SA-MP Forums Archive
Problem with Dialog Spoof - 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: Problem with Dialog Spoof (/showthread.php?tid=513985)



Problem with Dialog Spoof - cedizon - 19.05.2014

DEFINES=
pawn Код:
#define RRMENU 10253
#define RRMENUWEP 10254
#define RRMENUSKIN 10255
CMD=
pawn Код:
CMD:rapid(playerid, params[])
{
    if(PlayerInfo[playerid][pFaction] == 6 || PlayerInfo[playerid][pLeader] == 6 || PlayerInfo[playerid][pFaction] == 17 || PlayerInfo[playerid][pLeader] == 17)
    {
        SetPVarInt(playerid, "dialog", RRMENU);
        ShowPlayerDialogEx(playerid, RRMENU, DIALOG_STYLE_LIST, "Rapid Recovery","Rapid Uniforms\nRapid Equipment\nRefill Health($1000)\nKevlar Vest($1000)\nMechanic Job", "Select", "Cancel");
    }
    return 1;
}
DialogResponse=
pawn Код:
else if(dialogid == 10253)
    {
        if(response) switch(listitem)
        {
            case 0: // CAL Uniforms
            {
                SetPVarInt(playerid, "dialog", RRMENU);
                ShowPlayerDialog(playerid, RRMENUSKIN, DIALOG_STYLE_LIST, "Rapid Skins", "Mechanic\nMechanic 2\nMechanic 3", "Select", "Cancel");
            }
            case 1: // CAL Weapons
            {
                SetPVarInt(playerid, "dialog", RRMENU);
                ShowPlayerDialog(playerid, RRMENUWEP, DIALOG_STYLE_LIST, "Rapid Equipment","Shovel\nFire Extinguisher\nCamera", "Purchase", "Cancel");
            }
            case 2: // NG Heal
            {
                SetPlayerHealth(playerid, 100);
            }
            case 3:
            {
                SetPlayerArmour(playerid, 100);
            }
            case 4: // Mechanic
            {
                SetPVarInt(playerid, "dialog", RRMENU);
                ShowPlayerDialog(playerid, 7485, DIALOG_STYLE_LIST, "Mechanic Job", "Job Slot 1\nJob Slot 2", "Proceed", "Cancel");
            }
        }
    }
    else if(dialogid == 10255)
    {
        if(response)
        {
            if(listitem == 0) // LSPD Uniforms
            {
                SetPlayerSkin(playerid, 50);
                PlayerInfo[playerid][pSkin] = 50;
            }
            if(listitem == 1) //LSPD Uniforms
            {
                SetPlayerSkin(playerid, 8);
                PlayerInfo[playerid][pSkin] = 8;
            }
            if(listitem == 2) // LSPD Uniforms
            {
                SetPlayerSkin(playerid, 42);
                PlayerInfo[playerid][pSkin] = 42;
            }
        }
    }
    else if(dialogid == 10254)
    {
        if(response)
        {
            if(listitem == 0)
            {
                GivePlayerValidWeapon(playerid, 6, 1);
            }
            if(listitem == 1)
            {
                GivePlayerValidWeapon(playerid, 42, 999999);
            }
            if(listitem == 2)
            {
                GivePlayerValidWeapon(playerid, 43, 99999);
            }
        }
    }
I already did , change the Dialog name to Dialogid Still de Same




HELP ME THIS IS THE LAST PROBLEM THEN MY FACTION IS COMPLETE HELP PLEASE



Re: Problem with Dialog Spoof - jihadmeneer - 19.05.2014

When does the message appear? When you do /rapid or when you click on a listitem?

Show us the code for spoofing dialogs.

Код:
CMD:rapid(playerid, params[])
{
    if(PlayerInfo[playerid][pFaction] == 6 || PlayerInfo[playerid][pLeader] == 6 || PlayerInfo[playerid][pFaction] == 17 || PlayerInfo[playerid][pLeader] == 17)
    {
        SetPVarInt(playerid, "dialog", RRMENU);
        printf("DialogID == %d || PVar Dialog: %d", RRMENU, GetPVarInt(playerid, "dialog"));
        ShowPlayerDialogEx(playerid, RRMENU, DIALOG_STYLE_LIST, "Rapid Recovery","Rapid Uniforms\nRapid Equipment\nRefill Health($1000)\nKevlar Vest($1000)\nMechanic Job", "Select", "Cancel");
    }
    return 1;
}
Tell me what it prints.

__________________________________________________ _________________

Found this on your previous thread, use this code and tell me the debug:

Код:
if(GetPVarInt(playerid, "dialog") != dialogid) { // Confirm the dialogid matches what we have in the PVar
        format(string, sizeof(string), "{AA3333}AdmWarning{FFFF00}: %s (ID %d) is possibly trying to spoof a dialog ID (%d).", GetPlayerNameEx(playerid), playerid, dialogid);
        ABroadCast(COLOR_YELLOW, string, 2);

        printf("Debug 2: DialogID == %d || PVar Dialog: %d", dialog, GetPVarInt(playerid, "dialog"));
    
        format(string, sizeof(string), "%s has possibly tried to spoof a dialog ID.", GetPlayerNameEx(playerid));
        AddAutomatedFlag(playerid, string);

        format(string, sizeof(string), "%s has possibly tried to spoof a dialog ID (%d, %d).", GetPlayerNameEx(playerid), dialogid, response);
        Log("logs/crash.log", string);

        return 1;
    }



Re: Problem with Dialog Spoof - cedizon - 20.05.2014

And yes , when i clicked an item the Server Said "Possibly Spoof a Dialog"

pawn Код:
if(GetPVarInt(playerid, "dialog") != dialogid) { // Confirm the dialogid matches what we have in the PVar
        format(string, sizeof(string), "{AA3333}AdmWarning{FFFF00}: %s (ID %d) is possibly trying to spoof a dialog ID (%d).", GetPlayerNameEx(playerid), playerid, dialogid);
        ABroadCast(COLOR_YELLOW, string, 2);

        format(string, sizeof(string), "%s has possibly tried to spoof a dialog ID.", GetPlayerNameEx(playerid));
        AddAutomatedFlag(playerid, string);

        format(string, sizeof(string), "%s has possibly tried to spoof a dialog ID (%d, %d).", GetPlayerNameEx(playerid), dialogid, response);
        Log("logs/crash.log", string);

        return 1;
    }



Re: Problem with Dialog Spoof - cedizon - 20.05.2014

When i put your Code to my GM , Error comes

pawn Код:
if(GetPVarInt(playerid, "dialog") != dialogid) { // Confirm the dialogid matches what we have in the PVar
        format(string, sizeof(string), "{AA3333}AdmWarning{FFFF00}: %s (ID %d) is possibly trying to spoof a dialog ID (%d).", GetPlayerNameEx(playerid), playerid, dialogid);
        ABroadCast(COLOR_YELLOW, string, 2);

        printf("Debug 2: DialogID == %d || PVar Dialog: %d", dialog, GetPVarInt(playerid, "dialog"));
   
        format(string, sizeof(string), "%s has possibly tried to spoof a dialog ID.", GetPlayerNameEx(playerid));
        AddAutomatedFlag(playerid, string);

        format(string, sizeof(string), "%s has possibly tried to spoof a dialog ID (%d, %d).", GetPlayerNameEx(playerid), dialogid, response);
        Log("logs/crash.log", string);

        return 1;
    }
This is the ERROR
C:\Users\pc\Desktop\Server\gamemodes\VGRP.pwn(6051 2) : error 017: undefined symbol "dialog"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.


Re: Problem with Dialog Spoof - denom - 20.05.2014

Use this DialogResponse

pawn Код:
else if(dialogid == 10253)
    {
        if(response) switch(listitem)
        {
            case 0: // CAL Uniforms
            {
                SetPVarInt(playerid, "dialog", RRMENU);
                ShowPlayerDialogEx(playerid, RRMENUSKIN, DIALOG_STYLE_LIST, "Rapid Skins", "Mechanic\nMechanic 2\nMechanic 3", "Select", "Cancel");
            }
            case 1: // CAL Weapons
            {
                SetPVarInt(playerid, "dialog", RRMENU);
                ShowPlayerDialogEx(playerid, RRMENUWEP, DIALOG_STYLE_LIST, "Rapid Equipment","Shovel\nFire Extinguisher\nCamera", "Purchase", "Cancel");
            }
            case 2: // NG Heal
            {
                SetPlayerHealth(playerid, 100);
            }
            case 3:
            {
                SetPlayerArmour(playerid, 100);
            }
            case 4: // Mechanic
            {
                SetPVarInt(playerid, "dialog", RRMENU);
                ShowPlayerDialogEx(playerid, 7485, DIALOG_STYLE_LIST, "Mechanic Job", "Job Slot 1\nJob Slot 2", "Proceed", "Cancel");
            }
        }
    }
    else if(dialogid == 10255)
    {
        if(response)
        {
            if(listitem == 0) // LSPD Uniforms
            {
                SetPlayerSkin(playerid, 50);
                PlayerInfo[playerid][pSkin] = 50;
            }
            if(listitem == 1) //LSPD Uniforms
            {
                SetPlayerSkin(playerid, 8);
                PlayerInfo[playerid][pSkin] = 8;
            }
            if(listitem == 2) // LSPD Uniforms
            {
                SetPlayerSkin(playerid, 42);
                PlayerInfo[playerid][pSkin] = 42;
            }
        }
    }
    else if(dialogid == 10254)
    {
        if(response)
        {
            if(listitem == 0)
            {
                GivePlayerValidWeapon(playerid, 6, 1);
            }
            if(listitem == 1)
            {
                GivePlayerValidWeapon(playerid, 42, 999999);
            }
            if(listitem == 2)
            {
                GivePlayerValidWeapon(playerid, 43, 99999);
            }
        }
    }



Re: Problem with Dialog Spoof - jihadmeneer - 20.05.2014

Quote:
Originally Posted by cedizon
Посмотреть сообщение
When i put your Code to my GM , Error comes

pawn Код:
if(GetPVarInt(playerid, "dialog") != dialogid) { // Confirm the dialogid matches what we have in the PVar
        format(string, sizeof(string), "{AA3333}AdmWarning{FFFF00}: %s (ID %d) is possibly trying to spoof a dialog ID (%d).", GetPlayerNameEx(playerid), playerid, dialogid);
        ABroadCast(COLOR_YELLOW, string, 2);

        printf("Debug 2: DialogID == %d || PVar Dialog: %d", dialogid, GetPVarInt(playerid, "dialog"));
   
        format(string, sizeof(string), "%s has possibly tried to spoof a dialog ID.", GetPlayerNameEx(playerid));
        AddAutomatedFlag(playerid, string);

        format(string, sizeof(string), "%s has possibly tried to spoof a dialog ID (%d, %d).", GetPlayerNameEx(playerid), dialogid, response);
        Log("logs/crash.log", string);

        return 1;
    }
This is the ERROR
C:\Users\pc\Desktop\Server\gamemodes\VGRP.pwn(6051 2) : error 017: undefined symbol "dialog"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase

1 Error.
Not needed anymore read the post above me, I am going to explain you why it wasn't working, it wasn't working because when you click on a listitem of a dialog it switches dialogid and you didn't add that under ondialogresponse therefore it bugged, take the code from the code above me and it should be fine.


Re: Problem with Dialog Spoof - cedizon - 20.05.2014

@Denom I love you! ,i'm pinoy too where you from at PH??

I got a little problem now , when i click Kevlar vest at /rapid the server Said

Is Possibly Armor Hacking