Convert this into a dialog? - 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: Convert this into a dialog? (
/showthread.php?tid=387422)
Convert this into a dialog? -
Eminem 2ka9 - 24.10.2012
Hello, I would like to convert this into a dialog but I'm unsure how to.
pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
gPlayerClass[playerid] = ASSAULT_CLASS;
SetPlayerPos(playerid,220.3261,1822.9734,7.5368);
SetPlayerCameraLookAt(playerid,220.3261,1822.9734,7.5368);
SetPlayerCameraPos(playerid,226.7491,1823.0441,7.4141);
SetPlayerFacingAngle(playerid, 270 );
ApplyAnimation(playerid,"DANCING","DNCE_M_B",4.0,1,0,0,0,-1); //smooth dancing
CreateExplosion(212.9525,1822.9084,6.4141, 11, 10.0);
// TEAM STUFF
if(classid == TEAM_GERMANY) {
SetPlayerSkin(playerid, 179);
GameTextForPlayer(playerid,"~g~GERMANY",1000,4);
SetPlayerColor(playerid, TEAM_GERMANY_COLOR);
gTeam[playerid] = TEAM_GERMANY;
}
if(classid == TEAM_IRAQ) {
SetPlayerSkin(playerid, 128);
GameTextForPlayer(playerid,"~p~Taliban Cell",1000,4);
SetPlayerColor(playerid, TEAM_IRAQ_COLOR);
gTeam[playerid] = TEAM_IRAQ;
}
if(classid == TEAM_RUSSIA) {
SetPlayerSkin(playerid, 206);
GameTextForPlayer(playerid,"~r~Soviet Union",1000,4);
SetPlayerColor(playerid, TEAM_RUSSIA_COLOR);
gTeam[playerid] = TEAM_RUSSIA;
}
if(classid == TEAM_USA) {
SetPlayerSkin(playerid, 287);
GameTextForPlayer(playerid,"~b~United States of America",1000,4);
SetPlayerColor(playerid, TEAM_USA_COLOR);
gTeam[playerid] = TEAM_USA;
}
if(classid == TEAM_BANGLADESH) {
SetPlayerSkin(playerid, 285);
GameTextForPlayer(playerid,"~p~European Alliance",1000,4);
SetPlayerColor(playerid, TEAM_BANGLADESH_COLOR);
gTeam[playerid] = TEAM_BANGLADESH;
}
return 1;
}
Re: Convert this into a dialog? -
ThePhenix - 24.10.2012
PHP код:
#define DIALOG_TEAMS 3
//......................................................//
//......................................................//
//......................................................//
//......................................................//
//......................................................//
public OnPlayerConnect(playerid)
{
ShowPlayerDialog(playerid, DIALOG_TEAMS, DIALOG_STYLE_LIST, "Teams", "Germany\nIraq\nRussia", "Choose", "Quit");
return 1;
}
//......................................................//
//......................................................//
//......................................................//
//......................................................//
//......................................................//
//......................................................//
//......................................................//
//......................................................////......................................................//
//......................................................//
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == DIALOG_TEAMS)
{
if(response)
{
if(listitem == 0)
{
SetPlayerSkin(playerid, 179);
SendClientMessage(playerid, GREEN, "Welcome to GERMANY");
SetPlayerColor(playerid, TEAM_GERMANY_COLOR);
gTeam[playerid] = TEAM_GERMANY;
}
if(listitem == 1)
{
SendClientMessage(playerid, GREEN, "Welcome to IRAQ");
SetPlayerSkin(playerid, 128);
GameTextForPlayer(playerid,"~p~Taliban Cell",1000,4);
SetPlayerColor(playerid, TEAM_IRAQ_COLOR);
gTeam[playerid] = TEAM_IRAQ;
}
if(listitem == 2)
{
SendClientMessage(playerid, GREEN, "Welcome to Russia");
SetPlayerSkin(playerid, 206);
GameTextForPlayer(playerid,"~r~Soviet Union",1000,4);
SetPlayerColor(playerid, TEAM_RUSSIA_COLOR);
gTeam[playerid] = TEAM_RUSSIA;
}
}
return 1;
}
return 0;
}
Re: Convert this into a dialog? -
Eminem 2ka9 - 24.10.2012
Hm you help a lot, deserves a rep!=]