27.10.2012, 17:02
I want to make sure people don't "esc" out of my dialog because that would be silly...
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 80)
{
if(response)
{
if(GetPlayerScore(playerid) >= 0)//Private
{
gPlayerClass[playerid] = ASSAULT_CLASS;
PickedClass[playerid] = 1;
SetPlayerVirtualWorld(playerid, 0);
GivePlayerWeapon(playerid, 24, 200);
GivePlayerWeapon(playerid, 31, 500);
GivePlayerWeapon(playerid, 17, 5);
}
}
if(listitem == 1)//sniper DONE
{
if(GetPlayerScore(playerid) >= 10)//Private
{
gPlayerClass[playerid] = SNIPER_CLASS;
PickedClass[playerid] = 1;
SetPlayerVirtualWorld(playerid, 0);
GivePlayerWeapon(playerid, 23, 500);
GivePlayerWeapon(playerid, 34, 100);
GivePlayerWeapon(playerid, 29, 200);
}
}
if(listitem == 2)//pilot DONE
{
if(GetPlayerScore(playerid) >= 1150)//Lieutenant Colonel
{
gPlayerClass[playerid] = AIRMAN_CLASS;
PickedClass[playerid] = 1;
SetPlayerVirtualWorld(playerid, 0);
GivePlayerWeapon(playerid, 22, 50);
GivePlayerWeapon(playerid, 29, 500);
GivePlayerWeapon(playerid, 16, 5);
}
}
if(listitem == 3)//Engineer
{
if(GetPlayerScore(playerid) >= 250)//Sergeant
{
gPlayerClass[playerid] = ENGINEER_CLASS;
PickedClass[playerid] = 1;
SetPlayerVirtualWorld(playerid, 0);
GivePlayerWeapon(playerid, 22, 100);
GivePlayerWeapon(playerid, 32, 500);
GivePlayerWeapon(playerid, 35, 5);
}
}
if(listitem == 4)//FlameThrower
{
if(GetPlayerScore(playerid) >= 400)//CAPTAIN
{
gPlayerClass[playerid] = FLAMETHROWER_CLASS;
PickedClass[playerid] = 1;
SetPlayerVirtualWorld(playerid, 0);
GivePlayerWeapon(playerid, 24, 200);
GivePlayerWeapon(playerid, 30, 200);
GivePlayerWeapon(playerid, 37, 200);
}
}
if(listitem == 5)//Medic
{
if(GetPlayerScore(playerid) >= 0)//Private
{
SetPlayerSkin(playerid, 274);//medic skin
gPlayerClass[playerid] = MEDIC_CLASS;
PickedClass[playerid] = 1;
SetPlayerVirtualWorld(playerid, 0);
SetPlayerHealth(playerid, 5000000);
}
}
return 1;
}
return 1;
}