Callback not call [MSELECTION]
#1

Hi, I have my callback OnPlayerModelSelection (playerid, response, listid, ModelID) is not called, I do not see why I is not no fs.

thank you

Код:
public ACHAT_SUPERETTE(playerid)
{
	new Article[6];
	Article[0] = 19513; // Tйlйphone
	Article[1] = 19171; // Carte de Los Santos
	Article[2] = 18645; // Casque
	Article[3] = 2490; // Credits
	Article[4] = 1484; // Eau
	Article[5] = 3027; // Cigarette
    ShowModelSelectionMenuEx(playerid,Article, 6, "[Superette]",MENU_ACHAT_SUPERETTE,16.0, 0.0, -55.0);
    return 1;
}
Код:
public OnPlayerModelSelection(playerid, response, listid, modelid)
{
	printf("teste");
    if(listid == MENU_ACHAT_SUPERETTE)
    {
        printf("teste1");
        if(response)
        {
            printf("teste2");
			if(modelid == 19513)
			{
               ID_ACHAT_OBJECT[playerid] = 19513;
               PRIX_ACHAT_OBJECT[playerid] = 90+COM_INFO[IdCommerce[playerid]][COM_TAXE];
               format(stringtmp, TAILLE_STRING_CLASSIC, "Nom de l'objet: Tйlйphone\nPrix de l'objet: %d$\nNombre d'unitй: 1",PRIX_ACHAT_OBJECT[playerid]);
               ShowPlayerDialog(playerid,DIALOGUE_ACHAT_PRODUITS_SUPERETTE , DIALOG_STYLE_MSGBOX,"Superette",stringtmp,"Achetй","Retour");
               return 1;
            }
			if(modelid == 19171)
			{
               ID_ACHAT_OBJECT[playerid] = 19171;
               PRIX_ACHAT_OBJECT[playerid] = 5+COM_INFO[IdCommerce[playerid]][COM_TAXE];
               format(stringtmp, TAILLE_STRING_CLASSIC, "Nom de l'objet: Carte de Los Santos\nPrix de l'objet: %d$\nNombre d'unitй: 1",PRIX_ACHAT_OBJECT[playerid]);
               ShowPlayerDialog(playerid,DIALOGUE_ACHAT_PRODUITS_SUPERETTE , DIALOG_STYLE_MSGBOX,"Suprette",stringtmp,"Achetй","Retour");
               return 1;
            }
			if(modelid == 18645)
			{
               ID_ACHAT_OBJECT[playerid] = 18645;
               PRIX_ACHAT_OBJECT[playerid] = 100+COM_INFO[IdCommerce[playerid]][COM_TAXE];
               format(stringtmp, TAILLE_STRING_CLASSIC, "Nom de l'objet: Casque\nPrix de l'objet: %d$\nNombre d'unitй: 1",PRIX_ACHAT_OBJECT[playerid]);
               ShowPlayerDialog(playerid,DIALOGUE_ACHAT_PRODUITS_SUPERETTE , DIALOG_STYLE_MSGBOX,"Superette",stringtmp,"Achetй","Retour");
               return 1;
            }
			if(modelid == 2490)
			{
               ID_ACHAT_OBJECT[playerid] = 2490;
               PRIX_ACHAT_OBJECT[playerid] = 25+COM_INFO[IdCommerce[playerid]][COM_TAXE];
               format(stringtmp, TAILLE_STRING_CLASSIC, "Nom de l'objet: Credits de tйlйphone\nPrix de l'objet: %d$\nNombre d'unitй: 20",PRIX_ACHAT_OBJECT[playerid]);
               ShowPlayerDialog(playerid,DIALOGUE_ACHAT_PRODUITS_SUPERETTE , DIALOG_STYLE_MSGBOX,"Superette",stringtmp,"Achetй","Retour");
               return 1;
            }
			if(modelid == 1484)
			{
               ID_ACHAT_OBJECT[playerid] = 2490;
               PRIX_ACHAT_OBJECT[playerid] = 2+COM_INFO[IdCommerce[playerid]][COM_TAXE];
               format(stringtmp, TAILLE_STRING_CLASSIC, "Nom de l'objet: Bouteille d'eau\nPrix de l'objet: %d$\nNombre d'unitй: 1",PRIX_ACHAT_OBJECT[playerid]);
               ShowPlayerDialog(playerid,DIALOGUE_ACHAT_PRODUITS_SUPERETTE , DIALOG_STYLE_MSGBOX,"Superette",stringtmp,"Achetй","Retour");
               return 1;
            }
			if(modelid == 3027)
			{
               ID_ACHAT_OBJECT[playerid] = 3027;
               PRIX_ACHAT_OBJECT[playerid] = 15+COM_INFO[IdCommerce[playerid]][COM_TAXE];
               format(stringtmp, TAILLE_STRING_CLASSIC, "Nom de l'objet: Cigarette\nPrix de l'objet: %d$\nNombre d'unitй: 10",PRIX_ACHAT_OBJECT[playerid]);
               ShowPlayerDialog(playerid,DIALOGUE_ACHAT_PRODUITS_SUPERETTE , DIALOG_STYLE_MSGBOX,"Superette",stringtmp,"Achetй","Retour");
               return 1;
            }

        }
        return 1;
    }
    return 1;
}
Reply
#2

pawn Код:
ShowModelSelectionMenuEx(playerid, items_array[], item_amount, header_text[], extraid, Float:Xrot = 0.0, Float:Yrot = 0.0, Float:Zrot = 0.0, Float:mZoom = 1.0, dialogBGcolor = 0x4A5A6BBB, previewBGcolor = 0x88888899 , tdSelectionColor = 0xFFFF00AA)

forward OnPlayerModelSelectionEx(playerid, response, extraid, modelid);
Move your codes to OnPlayerModelSelectionEx instead of public OnPlayerModelSelection(playerid, response, listid, modelid)
https://sampforum.blast.hk/showthread.php?tid=407045
Take a look there also that example created by d0
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp(cmdtext, "/selectVehicleTrailer", true) == 0)
    {
        new cars[15];
        cars[0] = 435;
        cars[1] = 450;
        cars[2] = 569;
        cars[3] = 570;
        cars[4] = 584;
        cars[5] = 590;
        cars[6] = 591;
        cars[7] = 606;
        cars[8] = 607;
        cars[9] = 608;
        cars[10] = 610;
        cars[11] = 611;
        ShowModelSelectionMenuEx(playerid, cars, 12, "Select trailer", CUSTOM_TRAILER_MENU, 16.0, 0.0, -55.0);
        return 1;
    }
    return 0;
}

public OnPlayerModelSelectionEx(playerid, response, extraid, modelid)
{
    if(extraid == CUSTOM_TRAILER_MENU)
    {
        if(response)
        {
            SendClientMessage(playerid, 0xFF0000FF, "Trailer Spawned");
            new Float:pos[3]; GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
            CreateVehicle(modelid, pos[0] + 2.5, pos[1], pos[2] + 2.5, 0.0, random(128), random(128), -1);
        }
        else SendClientMessage(playerid, 0xFF0000FF, "Canceled trailer selection");
    }
    return 1;
}
Reply
#3

Perfect +3 for you by cons, I created a textdraw to view the stats of the player, and when I do /buy (it displays the menu) it puts me over the textdraw
Reply
#4

Thanks for reputations , could you explain more please sorry i didn't got you
PS:This forum requires that you wait 240 seconds between posts. Please try again in 143 seconds. :/
Reply
#5

Made in, I created a textdraw to view the stats of the player at the top right, but when I display my ShowModelSelectionMenuEx textdraw to view the stats passes over

Reply
#6

Can you show the codes where you create the textdraw ? or check the littersize there ?
Reply
#7

You can just disable this text-draws for a while till you buy or cancel mselection , i think its a bug from mselection never heard about that before ,
pawn Код:
new Hidetextdraws[MAX_PLAYERS];
And however your command it is add Hidetextdraws =1;, if(Hidetextdraws[playerid] == 1)
{
TextDrawHideForPlayer(playerid, TextDrawid);
}
once he cancel using mselection set his hidetextdraws variable back to 0 and show him textdraws back.
Reply
#8

Tank You
Reply


Forum Jump:


Users browsing this thread: 7 Guest(s)