Spawn Dialog Problem - 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: Spawn Dialog Problem (
/showthread.php?tid=662697)
Spawn Dialog Problem -
Mohaowmad - 08.01.2019
Hello
When i Click Button1 = "SPAWN"
Nothing Will Happen & Dialog Button 1 won't do anything
plz help
Код:
OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
switch( dialogid )
{
case 1:
{
if( response )
{
switch( listitem )
{
case 0: // Class 1
{
ShowPlayerDialog(playerid, DIALOG_SPAWN_CLASS, DIALOG_STYLE_LIST, "Shahre Khod Ra Entekhab Namaed", "{FFFF00}AazarBayijan\n{FFFF00}Ardebil\n{FFFF00}Oroomie\n{FFFF00}Zanjan", "{FF0000}SPAWN", "{008000}Khoruj");
{
switch(dialogid)
{
case DIALOG_SPAWN_CLASS:
{
if(response == DIALOG_SPAWN_CLASS)
{
switch(listitem)
{
case 0:
{
SetSpawnInfo( playerid, 0, 0, 1958.33, 1343.12, 15.36, 269.15, 26, 36, 28, 150, 0, 0 );
SpawnPlayer(playerid);
SetPlayerColor(playerid, COLOR_YELLOW);
}
}
}
}
}
}
// add your spawn positions.. or w.e
}
case 1: //class 2
{
}
case 2: // class 3
{
}
// and soo on
}
}
else
{
ShowPlayerDialog( playerid, DIALOG_SPAWN_CLASS, DIALOG_STYLE_LIST, "Select Your Class:-", "CLASS 1\nCLASS2\nCLASS 3", "Select", "Cancel" );
}
}
Re: Spawn Dialog Problem -
lWiDuAlKl - 08.01.2019
Try this:
Код:
forward OnLogin(playerid);// definim callback ul
public OnLogin(playerid)// facem publicul
{
printf("OnLogin called");
SetSpawnInfo( playerid, 0, 0, 1958.33, 1343.12, 15.36, 269.15, 26, 36, 28, 150, 0, 0 );
SpawnPlayer(playerid);
SetPlayerColor(playerid, COLOR_YELLOW);
return 1;
}
Код:
case DIALOG_SPAWN_CLASS:
{
if(response == DIALOG_SPAWN_CLASS)
{
switch(listitem)
{
case 0:
{
OnLogin(playerid);
}
}
}
}
and show if you have message in console.
Re: Spawn Dialog Problem -
oghabanjb - 09.01.2019
Dadash ino test kon:
Albate khodam test nakardam.
PHP код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
switch(dialogid)
{
case 1:
{
if(response)
{
switch(listitem)
{
case 0: // Class 1
{
ShowPlayerDialog(playerid, DIALOG_SPAWN_CLASS, DIALOG_STYLE_LIST, "Shahre Khod Ra Entekhab Namaed", "{FFFF00}AazarBayijan\n{FFFF00}Ardebil\n{FFFF00}Oroomie\n{FFFF00}Zanjan", "{FF0000}SPAWN", "{008000}Khoruj");
}
case 2:...
}
}
}
case DIALOG_SPAWN_CLASS:
{
if(response)
{
switch(listitem)
{
case 0:
{
SetSpawnInfo(playerid, 0, 0, 1958.33, 1343.12, 15.36, 269.15, 26, 36, 28, 150, 0, 0);
SpawnPlayer(playerid);
SetPlayerColor(playerid, COLOR_YELLOW);
}
}
}
}
}
return 0;
}