28.01.2012, 10:15
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:
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;
}