30.12.2011, 20:46
Ok so,i made a class dialog that show everytime a player spawns.But there is a problem,when a dialogbox appear,if i press ESC,no option where selected from the dialog and i got normal cj skin.
How to fix this problem?
here is the dialog:
OnPlayerSpawn:
Thanks.
How to fix this problem?
here is the dialog:
pawn Код:
if(dialogid == 888)
{
if(response)
{
if(listitem == 0) // Assault
{
SetPlayerArmour(playerid, 90.0);
GivePlayerWeapon(playerid, 24, 75);
GivePlayerWeapon(playerid, 27, 50);
GivePlayerWeapon(playerid, 31, 120);
SetPlayerSkin(playerid, 124);
}
if(listitem == 1) // Demolition
{
if(GetPlayerScore(playerid) < 500)
{
SendClientMessage(playerid,0xFF0000AA,"You need 500 score for Demolition class.");
ShowPlayerDialog(playerid, 888, DIALOG_STYLE_LIST, "******CLASS******", "Assault\nDemolition\nExpert\nSniper\nDamager", "Ok", "");
return 0;
}
else if(GetPlayerScore(playerid) > 500)
{
SetPlayerArmour(playerid, 90.0);
GivePlayerWeapon(playerid, 35, 5);
GivePlayerWeapon(playerid, 28, 150);
GivePlayerWeapon(playerid, 16, 10);
SetPlayerSkin(playerid, 179);
}
}
if(listitem == 2) // Expert
{
if(GetPlayerScore(playerid) < 1000)
{
SendClientMessage(playerid,0xFF0000AA,"You need 1000 score for Expert class.");
ShowPlayerDialog(playerid, 888, DIALOG_STYLE_LIST, "******CLASS******", "Assault\nDemolition\nExpert\nSniper\nDamager", "Ok", "");
return 0;
}
else if(GetPlayerScore(playerid) > 1500)
{
SetPlayerArmour(playerid, 90.0);
GivePlayerWeapon(playerid, 26, 240);
GivePlayerWeapon(playerid, 24, 75);
GivePlayerWeapon(playerid, 17, 20);
GivePlayerWeapon(playerid, 37, 150);
SetPlayerSkin(playerid, 272);
}
}
if(listitem == 3) // Sniper
{
if(GetPlayerScore(playerid) < 100)
{
SendClientMessage(playerid,0xFF0000AA,"You need 100 score for Sniper class.");
ShowPlayerDialog(playerid, 888, DIALOG_STYLE_LIST, "******CLASS******", "Assault\nDemolition\nExpert\nSniper\nDamager", "Ok", "");
return 0;
}
else if(GetPlayerScore(playerid) > 100)
{
SetPlayerArmour(playerid, 90.0);
GivePlayerWeapon(playerid, 34, 200);
GivePlayerWeapon(playerid, 16, 20);
SetPlayerSkin(playerid, 183);
}
}
if(listitem == 4) // Damager
{
if(GetPlayerScore(playerid) < 100)
{
SendClientMessage(playerid,0xFF0000AA,"You need 5000 score for Damager class.");
ShowPlayerDialog(playerid, 888, DIALOG_STYLE_LIST, "******CLASS******", "Assault\nDemolition\nExpert\nSniper\nDamager", "Ok", "");
return 0;
}
else if(GetPlayerScore(playerid) > 5000)
{
SetPlayerArmour(playerid, 90.0);
GivePlayerWeapon(playerid, 35, 100);
SetPlayerSkin(playerid, 33);
}
}
}
return 1;
}
pawn Код:
ShowPlayerDialog(playerid, 888, DIALOG_STYLE_LIST, "******CLASS******", "Assault\nDemolition\nExpert\nSniper\nDamager", "Ok", "");