little 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: little dialog problem... (
/showthread.php?tid=314005)
little dialog problem... -
niels44 - 28.01.2012
hey guys,
i have made that when a player goes to /glass ( glass deahtmatch) then it is in a dm and when a player goes to somewhere else it has to show a dialog which says if u want to stay in dm mode or leave... but the dialog isnt showing up..
this are my codes:
pawn Код:
#define DIALOG_ISDM 20517
pawn Код:
public OnPlayerSpawn(playerid)
{
if( IsPlayerInDM[ playerid ] == 1)
{
ShowPlayerDialog(playerid, DIALOG_ISDM, DIALOG_STYLE_MSGBOX, "Leave DM", "{FF0000}you are in a DeathMatch right now,{00FF00}do you want to leave the deathmatch?", "leave", "stay");
}
new Random = random(sizeof(RandomSpawns));
SetPlayerPos(playerid, RandomSpawns[Random][0], RandomSpawns[Random][1], RandomSpawns[Random][2]);
SetPlayerInterior(playerid, 0);
SetTimerEx("Unfreeze", 2000, 0, "d", playerid);
GameTextForPlayer(playerid,"~g~Waiting for the Objects to load",2000,3);
neonpickup = CreatePickup(1318, 14, -2448.3794,-122.6430,26.1381, -1);
return 1;
}
pawn Код:
CMD:glass(playerid, params[])
{
IsPlayerInDM[ playerid ] = 1;
new string[128], pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
SetTimerEx("Unfreeze", 2000, 0, "d", playerid);
GameTextForPlayer(playerid,"~g~Waiting for the Objects to load",2000,3);
format(string, sizeof(string), "{FF0000}(/glass) {FFFF00}Player {FF0000}%s {FFFF00}has Teleported to {FF0000}Glass DeathMatch",pName);
SendClientMessageToAll(playerid, string);
new Random = random(sizeof(RandomSpawnGlassDM));
SetPlayerPos(playerid, RandomSpawnGlassDM[Random][0], RandomSpawnGlassDM[Random][1], RandomSpawnGlassDM[Random][2]);
SetPlayerFacingAngle(playerid, RandomSpawnGlassDM[Random][3]);
return 1;
}
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == DIALOG_ISDM){
if(response){
SetPlayerHealth(playerid, 0);
}
else{
SendClientMessage(playerid, COLOR_RED, "you are still in a deathmatch game right now");
}
}
return 1;
}
Re: little dialog problem... -
MasterJoker - 28.01.2012
check the filterscript or gamemode's OnDialogResponse if its return 1; if they are not all the same make sure they are at the same return value
Re: little dialog problem... -
niels44 - 28.01.2012
it is in the gamemode and it is returning 1...
Re: little dialog problem... -
niels44 - 28.01.2012
?? anyone can help me? pls?
Re: little dialog problem... -
iPLEOMAX - 28.01.2012
You check & show the dialog when a player
spawns.
If the player is being teleported (SetPlayerPos/etc).. It wouldn't call these functions (dialogs)