Dialog Help me Please
#1

What am I doing wrong? I'm trying to put the furniture objects to appear with the dialogs of this include, but it's making a mistake.Will someone help me solve it?

Include: https://sampforum.blast.hk/showthread.php?tid=570213

Erro:
Код:
C:\Users\Admin\Desktop\GM\RP\gamemodes\teste.pwn(52746) : error 017: undefined symbol "ExteriorFurnitureBuy3"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
If I remove "ExteriorFurnitureBuy3" Objects do not appear in the dialog

Code:

Код:
Dialog:ExteriorFurnitureBuy2(playerid, response, listitem, inputtext[])
{
	if(!response) return Dialog_Show(playerid, ExteriorFurnitureBuy, DIALOG_STYLE_LIST, "Selecione uma categoria de mуveis", GetHouseCategoryList(), "Selecionar", "Cancelar");

	gstr[0] = EOS;
	strcat(gstr, "Nome da mobнlia\tCost\n");
	for(new x = 0; x < MAX_FURNITURE; x++)
	{
		if(FurniData[x][fSubCategory] == listitem && FurniData[x][fCategory] == GetPVarInt(playerid, "FurnCat") && FurniData[x][fModel] != 0 && FurniData[x][fExteriorAllow])
		{
			format(sgstr, sizeof(sgstr), "%s\t$%s\n", FurniData[x][fuName], format_cash(FurniData[x][fPrice]));
			strcat(gstr, sgstr);
		}
	}
	ShowPlayerDialog(playerid, ExteriorFurnitureBuy3, DIALOG_STYLE_PREVIEW_MODEL, "Comprar mуveis", gstr, "Selecionar", "Cancelar");
	return true;
}
Reply
#2

Define it...
#define ExteriorFurnitureBuy3 FREE NUMBER(Ex: 320)
Reply
#3

Quote:
Originally Posted by maksicnm
Посмотреть сообщение
Define it...
#define ExteriorFurnitureBuy3 FREE NUMBER(Ex: 320)
I did, this stops appearing in dialog list as I want, and it worked, but the objects are not appearing, just skins.
Idk why, what’s wrong in the code? I just know that is something about. “model” of fmodel

Reply
#4

You are doing it wrong. The specifier syntax goes like this:
PHP код:
%i\t%
"%i" = your modelid
"%s" = your label (optional parameter)

So your format should be like this:
PHP код:
format(sgstrsizeof(sgstr), "%i\t%s~n~$%s\n"FurniData[x][fModel], FurniData[x][fuName], format_cash(FurniData[x][fPrice])); 
Reply
#5

Quote:
Originally Posted by Gammix
Посмотреть сообщение
You are doing it wrong. The specifier syntax goes like this:
PHP код:
%i\t%
"%i" = your modelid
"%s" = your label (optional parameter)

So your format should be like this:
PHP код:
format(sgstrsizeof(sgstr), "%i\t%s~n~$%s\n"FurniData[x][fModel], FurniData[x][fuName], format_cash(FurniData[x][fPrice])); 
yes, it was exactly that, but why when I click on the object it does not spawn like it should?
In the old dialog list spawns normally
Reply
#6

UP.... HELP
Why does not the object spawn?
Reply
#7

Quote:
Originally Posted by Revolts
Посмотреть сообщение
UP.... HELP
Why does not the object spawn?
What do you mean? Explain more with code
Reply
#8

Quote:
Originally Posted by 0x88
Посмотреть сообщение
What do you mean? Explain more with code
include used: https://sampforum.blast.hk/showthread.php?tid=570213

check the images below

1 - The normal code is that, can you see objects in list and spawning the object normally.

https://i.imgur.com/gxFyJWJ.png
PHP код:
Dialog:FurniturePurchase2(playeridresponselistiteminputtext[])
{
    if(!
response) return Dialog_Show(playeridFurniturePurchaseDIALOG_STYLE_LIST"Selecione uma categoria de mуveis"GetHouseCategoryList(), "Selecionar""Cancelar");
    
gstr[0] = EOS;
    
strcat(gstr"Nome da mobнlia\tCusto\n");
    for(new 
0MAX_FURNITUREx++)
    {
        if(
FurniData[x][fSubCategory] == listitem && FurniData[x][fCategory] == GetPVarInt(playerid"FurnCat") && FurniData[x][fModel] != 0)
        {
            
format(sgstrsizeof(sgstr), "%s\t$%s\n"FurniData[x][fuName], format_cash(FurniData[x][fPrice]));
            
strcat(gstrsgstr);
        }
    }
    
Dialog_Show(playeridFurniturePurchase3DIALOG_STYLE_TABLIST_HEADERS"Comprar mуveis"gstr"Selecionar""Cancelar");
    return 
true;

2 - This code is modified as I want, but different from the above code, is not spawning the objects.
When click on the object to spawn, it just closes the dialog.

https://i.imgur.com/Ldf8gli.png
PHP код:
Dialog:FurniturePurchase2(playeridresponselistiteminputtext[])
{
    if(!
response) return Dialog_Show(playeridFurniturePurchaseDIALOG_STYLE_LIST"Selecione uma categoria de mуveis"GetHouseCategoryList(), "Selecionar""Cancelar");
    
gstr[0] = EOS;
    
strcat(gstr"Nome da mobнlia\tCusto\n");
    for(new 
0MAX_FURNITUREx++)
    {
        if(
FurniData[x][fSubCategory] == listitem && FurniData[x][fCategory] == GetPVarInt(playerid"FurnCat") && FurniData[x][fModel] != 0)
        {
            
format(sgstrsizeof(sgstr), "%i\t%s~n~$%s\n"FurniData[x][fModel], FurniData[x][fuName], format_cash(FurniData[x][fPrice]));
            
strcat(gstrsgstr);
        }
    }
    
ShowPlayerDialog(playeridFurniturePurchase3DIALOG_STYLE_PREVIEW_MODEL"Comprar mуveis"gstr"Selecionar""Cancelar");
    return 
true;

Reply
#9

Show us the response handler of dialogid: FurniturePurchase3.
Reply
#10

Quote:
Originally Posted by Gammix
Посмотреть сообщение
Show us the response handler of dialogid: FurniturePurchase3.
PHP код:
Dialog:FurniturePurchase(playeridresponselistiteminputtext[])
{
    if(!
response) return true;
    
Dialog_Show(playeridFurniturePurchase2DIALOG_STYLE_LIST"Select a category"GetSubcategoriesFromMainCat(listitem), "Selecionar""Cancelar");
    
SetPVarInt(playerid"FurnCat"listitem);
    return 
true;
}
Dialog:FurniturePurchase2(playeridresponselistiteminputtext[])
{
    if(!
response) return Dialog_Show(playeridFurniturePurchaseDIALOG_STYLE_LIST"Select a category"GetHouseCategoryList(), "Selecionar""Cancelar");
    
gstr[0] = EOS;
    
strcat(gstr"Nome da mobнlia\tCusto\n");
    for(new 
0MAX_FURNITUREx++)
    {
        if(
FurniData[x][fSubCategory] == listitem && FurniData[x][fCategory] == GetPVarInt(playerid"FurnCat") && FurniData[x][fModel] != 0)
        {
            
format(sgstrsizeof(sgstr), "%i\t%s~n~$%s\n"FurniData[x][fModel], FurniData[x][fuName], format_cash(FurniData[x][fPrice]));
            
strcat(gstrsgstr);
        }
    }
    
ShowPlayerDialog(playeridFurniturePurchase3DIALOG_STYLE_PREVIEW_MODEL"Buy furniture"gstr"Selecionar""Cancelar");
    return 
true;
}
Dialog:FurniturePurchase3(playeridresponselistiteminputtext[])
{
    if(!
response) return Dialog_Show(playeridFurniturePurchase2DIALOG_STYLE_LIST"Select a category"GetSubcategoriesFromMainCat(GetPVarInt(playerid"FurnCat")), "Selecionar""Cancelar");
    new 
= -1;
    for(new 
0MAX_FURNITUREx++)
    {
        if(
strmatch(inputtextFurniData[x][fuName]))
        {
            
x;
            break;
        }
    }
    if(
== -1) return SysMsg(playerid"Ocorreu um erro. Contate por favor um admin com o seguinte cуdigo de erro: FBNF"); //this should generally never happen but it's just a fail-safe.
    
new Float:pX,Float:pY,Float:pZ,Float:pA;
    
GetPlayerPos(playerid,pX,pY,pZ);
    
SetPlayerPos(playerid,pX-0.05,pY-0.05,pZ);
    
GetXYInFrontOfPlayer(playerid,pX,pY,1.0);
    
GetPlayerFacingAngle(playerid,pA);
    if(
strfind(inputtext"Wall"true) != -|| strfind(inputtext"Doorway"true) != -|| strfind(inputtext"Floor"true) != -|| strfind(inputtext"Carpet"true) != -|| strfind(inputtext"Divider"true) != -1pA pA 90.0;
    
PlayerBuyFurniture[playerid][0] = CreateDynamicObject(FurniData[f][fModel], pXpYpZ-0.50.00.0pAHouseData[IsInHouseID[playerid]][HouseVW]);
    
Streamer_Update(playerid);
    
EditDynamicObject(playeridPlayerBuyFurniture[playerid][0]);
    
PlayerBuyFurniture[playerid][1] = f;
    return 
true;

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)