Dialog Listitem - 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 Listitem (
/showthread.php?tid=498612)
Dialog Listitem -
ancezas - 04.03.2014
pawn Code:
if( dialogid == 312 )//Darbuotju valdymas...
{
if( response )
{
if( listitem )
{
new
msg[ 128 ];
format( msg, 128, "TEST %i", listitem );
InfoMSG( playerid, msg );
}
}
return true;
}
I want that if i pressed any of listitem it wil show me listitem id, but it isint
Re: Dialog Listitem -
]Rafaellos[ - 04.03.2014
It will display the message only if the listitem ID is 1. Remove if(listitem).
Re: Dialog Listitem -
Ryan_Undering - 04.03.2014
Quote:
Originally Posted by ancezas
pawn Code:
if( dialogid == 312 )//Darbuotju valdymas... { if( response ) { if( listitem ) { new msg[ 128 ]; format( msg, 128, "TEST %i", listitem ); InfoMSG( playerid, msg ); } } return true; }
I want that if i pressed any of listitem it wil show me listitem id, but it isint
|
What's the point in finding out the lisitem item ID if I can ask?
Re: Dialog Listitem -
ancezas - 04.03.2014
in main point i whant that from this dialog:
i get player name by listitems, the listitems is changing everytime
this dialog code is:
pawn Code:
case 1://Љiuo metu prisijungę darbuotojai
{
new
Index,
query[ 300 ],
query2[ 300 ],
str [ 1200 ];
format( query, 90, "UPDATE `zaidejai` SET `online` = '1' WHERE `vardas` = '%s'", GetPlayerNameEx( playerid ) );
mysql_query( query );
format( query, 200, "SELECT `vardas`,`darbas`,`online` FROM `zaidejai` WHERE `darbas` = '%d'",zInfo[ playerid ][ dyrikz ] );
mysql_query( query );
mysql_store_result();
if ( mysql_num_rows( ))
{
while( mysql_fetch_row( query2 ))
{
new
name[ MAX_PLAYER_NAME ],
factionid,
OnlineEx;
sscanf( query2, "p<|>s[24]ii", name, factionid, OnlineEx );
if ( !OnlineEx )
{
format( str, 1200, "%s%s - {FF0000}Atsijungęs\n{FFFFFF}", str, name );
Index++;
}
else
{
format( str, 1200, "%s%s - {00FF00}Prisijungęs\n{FFFFFF}", str, name );
Index++;
}
}
}
mysql_free_result();
if ( !Index )
{
ShowPlayerDialog( playerid, 312, DIALOG_STYLE_LIST, "{FF0000}» Jūsų darbuotojai", "{FF0000}Nėra nei vieno darbuotojo", "Gerai", "" );
}
else
{
ShowPlayerDialog( playerid, 312, DIALOG_STYLE_LIST, "{00FF00}» Jūsų darbuotojai", str, "Gerai", "" );
}
return 1;
}
Re: Dialog Listitem -
Necro[ABK] - 04.03.2014
Quote:
Originally Posted by ]Rafaellos[
It will display the message only if the listitem ID is 1. Remove if(listitem).
|
do as he^ says remove the if statement. u want it to do it if positive response not if listitem isn't 0 witch is basicly what u got.
Re: Dialog Listitem -
ancezas - 04.03.2014
i did this, it's okey, but how to get playername from listitem?
AW: Dialog Listitem -
Nero_3D - 04.03.2014
Inputtext returns the content of the line you selected, use sscanf (or just strfind) to extract the name
Re: Dialog Listitem -
ancezas - 04.03.2014
like can you show me some script of that? there is nothing to input
Re: Dialog Listitem -
ancezas - 04.03.2014
bump