SA-MP Forums Archive
dialog with strings problems! - 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: dialog with strings problems! (/showthread.php?tid=518960)



dialog with strings problems! - KillerStrike23 - 12.06.2014

@sup all, I gotta a problem since I started sicripting with strings in dialogs here is my code

pawn Код:
CMD:housestats(playerid,params[]){
    #pragma unused params
    new str[256],housenumber;
    housenumber = GetHouseID(playerid);
    format(str, sizeof(str), "Owner: %s\n", hInfo[housenumber][Name]);
    format(str, sizeof(str), "Cost: $%d\n", hInfo[housenumber][Cost]);
    format(str, sizeof(str), "Renter: %s\n", hInfo[housenumber][Renter]);
    format(str, sizeof(str), "Rentcost: $%d / hour\n", hInfo[housenumber][Rentcost]);
    strcat(str, "", sizeof(str));
    ShowPlayerDialog(playerid, DIALOG_STYLE_MSGBOX, "{FF0000}SFTDM - House Stats", str, "OK","");
    return 1;}
I don't know how to create many strings in dialog and if I tried to it crashes. :/

I would be thankfully if you helped me guys!


Re: dialog with strings problems! - Adityz - 12.06.2014

This should work -

pawn Код:
CMD:housestats(playerid,params[])
{
    new str[256],housenumber;
    housenumber = GetHouseID(playerid);
    format(str, sizeof(str), "Owner: %s\n", hInfo[housenumber][Name]);
    format(str, sizeof(str), "Cost: $%d\n", hInfo[housenumber][Cost]);
    format(str, sizeof(str), "Renter: %s\n", hInfo[housenumber][Renter]);
    format(str, sizeof(str), "Rentcost: $%d / hour\n", hInfo[housenumber][Rentcost]);
    ShowPlayerDialog(playerid, DIALOG_STYLE_MSGBOX, "{FF0000}SFTDM - House Stats", str, "OK","");
    return 1;
}



Re: dialog with strings problems! - Rittik - 12.06.2014

Код:
CMD:housestats(playerid,params[])
{
    #pragma unused params
    new str[256],str1[256]housenumber;
    housenumber = GetHouseID(playerid);
    format(str, sizeof(str), "Owner: %s\n", hInfo[housenumber][Name]);
    strcat(str1,str);
    format(str, sizeof(str), "Cost: $%d\n", hInfo[housenumber][Cost]);
    strcat(str1,str);
    format(str, sizeof(str), "Renter: %s\n", hInfo[housenumber][Renter]);
    strcat(str1,str);
    format(str, sizeof(str), "Rentcost: $%d / hour\n", hInfo[housenumber][Rentcost]);
    strcat(str1,str);
    ShowPlayerDialog(playerid, DIALOG_STYLE_MSGBOX, "{FF0000}SFTDM - House Stats", str1, "Okay","");
    return 1;
}



Re: dialog with strings problems! - Threshold - 12.06.2014

??

pawn Код:
CMD:housestats(playerid,params[])
{
    #pragma unused params
    new str[120], housenumber = GetHouseID(playerid);
    format(str, sizeof(str), "Owner: %s\nCost: $%d\nRenter: %s\nRentcost: $%d / hour", hInfo[housenumber][Name], hInfo[housenumber][Cost], hInfo[housenumber][Renter], hInfo[housenumber][Rentcost]);
    ShowPlayerDialog(playerid, DIALOG_STYLE_MSGBOX, "{FF0000}SFTDM - House Stats", str, "Okay","");
    return 1;
}
Lol?