04.09.2010, 16:16
pawn Код:
// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT
#include <a_samp>
#define weaponmenu 1
#if defined FILTERSCRIPT
#endif
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/weapons", true))
{
ShowPlayerDialog(playerid, weaponmenu, DIALOG_STYLE_LIST, "Weapons Menu", "Shawn-Off \nTec9 \nM4 \nSniper", "Select", "Cancel");
return 1;
}
return 0;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == weaponmenu)
{
if(response)
{
if(listitem == 0) //Shawn-Off
{
GivePlayerWeapon(playerid, 26, 5004);
SendClientMessage(playerid, 0xCC6600, "You have picked Shawn-Off");
return 1;
}
if(listitem == 1) //Tec9
{
GivePlayerWeapon(playerid, 32, 5100);
SendClientMessage(playerid, 0xCC6600, "You have picked Tec9");
return 1;
}
if(listitem == 2) //M4
{
GivePlayerWeapon(playerid, 67, 5050);
SendClientMessage(playerid, 0xCC6600, "You have picked M4");
return 1;
}
if(listitem == 3) //Sniper
{
GivePlayerWeapon(playerid, 34, 5000);
SendClientMessage(playerid, 0xCC6600, "You have picked Sniper Rifle");
}
}
}
return 1;
}