Код:
#define DIALOG_LAPD 99
#define DIALOG_LAPD2 999
#define DIALOG_LAPD3 8888 // At Top
//the command
if(strcmp(cmd, "/lapd",true) == 0)
{
if(IsPlayerConnected(playerid))
{
if (IsACop(playerid))
{
ShowPlayerDialog(playerid, DIALOG_LAPD, DIALOG_STYLE_LIST, "LAPD", "Duty\nUniform\nCivillian Skin\nWeapons","OK", "CANCLE");
}
else
{
SendClientMessage(playerid, COLOR_RED, "You are not a member of LAPD!");
}
}
else {
SendClientMessage(playerid, COLOR_ADD, "YOU ARE NOT CONNECTED YET!");
}
return 1;
}
//OnDialogResponse
if(dialogid == DIALOG_LAPD && response)
{
if(listitem == 0)
{
if(PlayerInfo[playerid][pDuty] == 0)
{
if(IsAFreecop(playerid))
{
format(string, sizeof(string), "* Voluntary Officer %s took a Badge and a Gun from his locker.", sendername);
ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
SafeResetPlayerWeapons(playerid);
SafeGivePlayerWeapon(playerid, 41, 150);
SafeGivePlayerWeapon(playerid, 24, 70);
SafeGivePlayerWeapon(playerid, 3, 0);
SetPlayerColor(playerid,0xa9c4e400);
PlayerInfo[playerid][pDuty] = 1;
PlayerInfo[playerid][pChar] = 71;
new factionskin = PlayerInfo[playerid][pChar];
SetPlayerSkin(playerid, factionskin);
SaveGuns(playerid);
return 1;
}
if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1)
{
format(string, sizeof(string), "* Officer %s took a Badge and a Gun from his locker.", sendername);
SendClientMessage(playerid, COLOR_WHITE, "Type /equip for equipments / Type /undercover to see UC Skins!");
SetPlayerSkin(playerid, 280);
SafeGivePlayerWeapon(playerid, 24, 300);
SafeGivePlayerWeapon(playerid, 31, 300);
SafeGivePlayerWeapon(playerid, 29, 300);
SafeGivePlayerWeapon(playerid, 41, 300);
SafeGivePlayerWeapon(playerid, 27, 100);
return 1;
}
}
else if(PlayerInfo[playerid][pDuty] == 1)
{
if(IsAFreecop(playerid))
{
format(string, sizeof(string), "* Voluntary Officer %s places his Badge and Gun in his locker.", sendername);
ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
SafeResetPlayerWeapons(playerid);
PlayerInfo[playerid][pDuty] = 0;
SetPlayerColor(playerid, TEAM_HIT_COLOR);
new originalskin = PlayerInfo[playerid][pModel];
SetPlayerSkin(playerid, originalskin);
PlayerInfo[playerid][pChar] = 0;
SetPlayerWeapons(playerid);
return 1;
}
if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1)
{
PlayerInfo[playerid][pDuty] = 0;
SetPlayerSkin(playerid, 303);
format(string, sizeof(string), "* Officer %s places his Badge and Gun in his locker.", sendername);
return 1;
}
}
}
if(listitem == 1)
{
switch(PlayerInfo[playerid][pRank])
{
case 1:
{
SetPlayerSkin(playerid, 280);
}
case 2:
{
SetPlayerSkin(playerid, 281);
}
case 3:
{
SetPlayerSkin(playerid, 282);
}
case 4:
{
SetPlayerSkin(playerid, 283);
}
case 5:
{
SetPlayerSkin(playerid, 284);
}
case 6:
{
SetPlayerSkin(playerid, 288);
}
case 7:
{
SetPlayerSkin(playerid, 266);
}
case 8:
{
SetPlayerSkin(playerid, 265);
}
}
}
if(listitem == 2)
{
ShowPlayerDialog(playerid, DIALOG_LAPD2, DIALOG_STYLE_INPUT, "Choose your skin:","Choose a skin that you want(must be a ID):","SET SKIN","CANCLE");
}
if(listitem == 3)
{
new string[300];
format(string,sizeof(string), "Shotgun\nDeagle\nPaper Sprey\nUzi\nMP5\nM4\nAK 47\n");
ShowPlayerDialog(playerid, DIALOG_LAPD3, DIALOG_STYLE_LIST, "Weapons",string,"OK","");
}
}
if(dialogid == DIALOG_LAPD2 && response)
{
SendClientMessage(playerid, -1, "Currently by a Chief this Feature is blocked. you cant use this!");
return 1;
}
if(dialogid == DIALOG_LAPD3 && response)
{
if(listitem == 0)
{
SafeGivePlayerWeapon(playerid, 25, 30);
}
if(listitem == 1)
{
SafeGivePlayerWeapon(playerid, 24, 50);
}
if(listitem == 2)
{
GivePlayerWeapon(playerid, 41, 30);
}
if(listitem == 3)
{
SafeGivePlayerWeapon(playerid, 28, 30);
}
if(listitem == 4)
{
if(PlayerInfo[playerid][pRank] >= 5)
{
GivePlayerWeapon(playerid, 29, 60);
}
}
if(listitem == 5)
{
if(PlayerInfo[playerid][pRank] >= 5)
{
GivePlayerWeapon(playerid, 31, 60);
}
}
if(listitem == 6)
{
if(PlayerInfo[playerid][pRank] >= 5)
{
GivePlayerWeapon(playerid, 32, 60);
}
}
}