Weapons in dialog list with keystatechange
#9

Код:
#define DIALOG_SWAT 991
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys && KEY_SECONDARY_ATTACK)
{
    if(IsPlayerInRangeOfPoint(playerid, 2.0, 1085.3313,-1186.0193,18.3062))*then
	{
        ShowPlayerDialog(playerid, DIALOG_SWAT, DIALOG_STYLE_LIST, "{00FFFF}SWAT:", "Equipment \nHealth \nArmour \nArmour + Kevlar \nNightstick \nSmoke Bomb \nDesert Eagle \nShotgun \nMP5 \nM4a1 \nSniper \nBACK", "Ok!", "Cancel");
		return 1;
	}
}
return 1;
}
Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == DIALOG_SWAT)
	{
  		switch(listitem)
		{
			case 0:
			{
                SetPlayerHealth(playerid, 100);
            	SendClientMessageToAll(playerid, COLOR_SWAT, "Dobio si health.");
 			}
			case 1:
			{
                SetPlayerArmour(playerid, 100);
				SendClientMessageToAll(playerid, COLOR_SWAT, "Dobio si pancir.");
 			}
 			case 2:
			{
                SetPlayerArmour(playerid, 200);
				SendClientMessageToAll(playerid, COLOR_SWAT, "Dobio si pancir i kevlar.");
 			}
 			case 3:
			{
                GivePlayerWeapon(playerid, 3, 1);
				SendClientMessageToAll(playerid, COLOR_SWAT, "Dobio si pendrek.");
 			}
 			case 4:
			{
                GivePlayerWeapon(playerid, 17, 100);
				SendClientMessageToAll(playerid, COLOR_SWAT, "Dobio si smoke bomb.");
 			}
 			case 5:
			{
                GivePlayerWeapon(playerid, 24, 1000);
				SendClientMessageToAll(playerid, COLOR_SWAT, "Dobio si deagle.");
 			}
 			case 6:
			{
                SetPlayerWeapon(playerid, 25, 1000);
				SendClientMessageToAll(playerid, COLOR_SWAT, "Dobio si shotgun.");
 			}
 			case 7:
			{
                GivePlayerWeapon(playerid, 29, 1000);
				SendClientMessageToAll(playerid, COLOR_SWAT, "Dobio si mp5.");
 			}
 			case 8:
			{
                GivePlayerWeapon(playerid, 31, 1000);
				SendClientMessageToAll(playerid, COLOR_SWAT, "Dobio si m4a1.");
 			}
 			case 9:
			{
                GivePlayerWeapon(playerid, 34, 1000);
				SendClientMessageToAll(playerid, COLOR_SWAT, "Dobio si sniper.");
 			}
		}
	 return 1;
}
 return 1;
}
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)