SA-MP Forums Archive
**(HELP)** - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: **(HELP)** (/showthread.php?tid=274085)



**(HELP)** - [MKD]Max - 04.08.2011

i have create this select town ...
now i need little help ...

Код:
new gPlayerCitySelection[MAX_PLAYERS];
new gPlayerHasCitySelected[MAX_PLAYERS];
Код:
public OnPlayerRequestSpawn(playerid)
{
	if(gPlayerCitySelection[playerid] == CITY_LOS_SANTOS){
	return 1;
	}


	if(gPlayerCitySelection[playerid] == CITY_SAN_FIERRO){
	return 1;
	}

	if(gPlayerCitySelection[playerid] == CITY_LAS_VENTURAS){
	return 1;
	}


	if(udb_Exists(PlayerName(playerid)) && PLAYERLIST_authed[playerid]) {
	ShowPlayerDialog(playerid,choosetown,DIALOG_STYLE_LIST,"Where you like to spawn?","Los Santos\nSan Fierro\nLas Venturas","OK","Default");
	return 0;
}

	return 1;
}

Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
	if(dialogid == choosetown)
	{
	    if(!response)
	    {
	    gPlayerCitySelection[playerid] = CITY_LOS_SANTOS;
    	SendClientMessage(playerid,COLOR_WHITE,"You have choose default you been spawned at los santos");
		return 1;
		}
		switch(listitem)
		{
		case 0:{
	    gPlayerCitySelection[playerid] = CITY_LOS_SANTOS;
  		SendClientMessage(playerid,COLOR_WHITE,"You have choose to spawn at los santos");
  		return 1;
		}
		case 1:{
	    gPlayerCitySelection[playerid] = CITY_SAN_FIERRO;
 		SendClientMessage(playerid,COLOR_WHITE,"You have choose to spawn at san feirro");
 		return 1;
		}
		case 2:{
	    gPlayerCitySelection[playerid] = CITY_LAS_VENTURAS;
 		SendClientMessage(playerid,COLOR_WHITE,"You have choose to spawn at las venturas");
		}
	}
}

all of this work i add too udner onplayerconnect
Код:
  	gPlayerCitySelection[playerid] = -1;
	gPlayerHasCitySelected[playerid] = 0;
it all work when i select SF its spawn me at Sf and same Ls and LV now all i need is how i can make when i get back again to the Class Select show me to choose wich city again please help


Re: **(HELP)** - Calgon - 04.08.2011

You can use the OnPlayerRequestClass callback to bring the dialog back to the screen, so a player can choose which town to spawn in. Here's the code:

pawn Код:
public OnPlayerRequestClass(playerid, classid) {
   gPlayerCitySelection[playerid] = -1;
    gPlayerHasCitySelected[playerid] = 0;
   ShowPlayerDialog(playerid,choosetown,DIALOG_STYLE_LIST,"Where you like to spawn?","Los Santos\nSan Fierro\nLas Venturas","OK","Default");
}



Re: **(HELP)** - [MKD]Max - 04.08.2011

thanks man thank you very much i owe one you realy help my sever