Using functions and variables in dialogs
#1



Can I get an example code for something along the lines of this? I'm just looking to understand how they did something like this through the style of dialog used.

PHP Code:
ShowPlayerDialog(playeriddialogidDIALOG_STYLE_TABLIST_HEADERS"Buy Weapon",
"Weapon\tPrice\tAmmo\n\
Deagle\t$5000\t100\n\
Sawnoff\t$5000\t100\n\
Pistol\t$1000\t50"
// Etc.
"Select""Cancel"); 
How can we use things like GetPlayerName and our custom functions. Haven't worked with dialogs in a long time.
Reply
#2

https://sampwiki.blast.hk/wiki/Format
Reply
#3

Quote:
Originally Posted by raydx
View Post
I've tried this, although my outcome didn't work. Any chance you can give me an example on how this could work?
Reply
#4

Code:
new string[150], string2[40];

//Dialog title:
format(string2, 40, "Injuries of %s", PlayerName(playerid));

//List:
format(string, 150, "%s%s\t%s\t%s\n", string, Injury[playerid][injury_type],Injury[playerid][injury_location], Injury[playerid][injury_weapon]);

//Headers:
format(string, 150, "Injury Type\tLocation\tWeapon\n%s", string);

//Showing dialog:
ShowPlayerDialog(playerid, dialogid, DIALOG_STYLE_TABLIST_HEADERS, string2, string);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)