I am trying to add a command where a dialog appears and users can select their equipment.
I am using a model from the script already. When I compile I get numerous errors.
Код:
if(strcmp(cmd, "/equip", true) == 0) // By Ryan_Bush
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pDuty] == 0)
{
SendClientMessage(playerid,COLOR_GREY,"** You are not On Duty!");
return 1;
}
if(IsPlayerInRangeOfPoint(playerid, 6, 1457.684,-1761.504,3285.285))//SAPD Lockers
{
if(PlayerInfo[playerid][pMember] != 1 && PlayerInfo[playerid][pLeader] != 1)
{
SendClientMessage(playerid,COLOR_GREY,"** This Refill Point is Only for the BPD");
return 1;
}
new sapdequip[] = "1\tCadet Equiptment\n2\tOfficer Equiptment\n3\tCorporal Equiptment\n4\tSergeant Equiptment\n5\tLieutenant Equiptment\n6\tCaptain Equiptment\n7\tAssistant Chief Equiptment\n8\tChief Equiptment\n9\tArmour+Health\n10\tRiot SWAT\n11\tSecurity SWAT\n12\tOperational SWAT\n13\tHigher SWAT\n14\tCoastguard Patrol\n15\tCoastguard Air Patrol\n16\tHigher Coastguard";
ShowPlayerDialog(playerid,50,DIALOG_STYLE_LIST,"List of Equips:",sapdequip,"Select","Cancel");
SendClientMessage(playerid, COLOR_GREY,"* REMEMBER, You may not be able to Select EVERYTHING, Each Item needs it's Specified Rank!");
}
else if(IsPlayerInRangeOfPoint(playerid, 6, -2188.6133,2411.9202,5.1563))//SWAT
{
if(PlayerInfo[playerid][pMember] != 1 && PlayerInfo[playerid][pLeader] != 1)
{
SendClientMessage(playerid,COLOR_GREY,"** This Refill Point is Only for the BPD/SWAT/COASTGUARD");
return 1;
}
new sapdequip[] = "1\tCadet Equiptment\n2\tOfficer Equiptment\n3\tCorporal Equiptment\n4\tSergeant Equiptment\n5\tLieutenant Equiptment\n6\tCaptain Equiptment\n7\tAssistant Chief Equiptment\n8\tChief Equiptment\n9\tArmour+Health\n10\tRiot SWAT\n11\tSecurity SWAT\n12\tOperational SWAT\n13\tHigher SWAT\n14\tCoastguard Patrol\n15\tCoastguard Air Patrol\n16\tHigher Coastguard";
ShowPlayerDialog(playerid,50,DIALOG_STYLE_LIST,"List of Equips:",sapdequip,"Select","Cancel");
SendClientMessage(playerid, COLOR_GREY,"* REMEMBER, You may not be able to Select EVERYTHING, Each Item needs it's Specified Rank!");
}
else if(IsPlayerInRangeOfPoint(playerid, 6, 1457.684,-1761.504,3285.285))//Equip for MI5 PROBLEM SECTION
{
if(PlayerInfo[playerid][PlayerInfo[playerid][pSs])
{
SendClientMessage(playerid,COLOR_GREY,"** This Refill Point is Only for the MI5");
return 1;
}
new mi5equip[] = "1\tSpy\n2\tAgent\n3\tSpecial Agent\n4\tCoordinator of Intelligence\n5\tDeputy Director General\n6\tDirector General
ShowPlayerDialog(playerid,52,DIALOG_STYLE_LIST,"List of Equips:",mi5equip,"Select","Cancel");
SendClientMessage(playerid, COLOR_GREY,"* REMEMBER, You may not be able to Select EVERYTHING"); //PROBLEM IS IN THIS NEWLY ADDED SECTION
new y, m, d;
new h,mi,s;
getdate(y,m,d);
gettime(h,mi,s);
format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s [CMD] -> /equip %d",d,m,y,h,mi,s,sendername, strval(tmp));
CommandLog(string);
return 1;
}
}
Код:
if(dialogid == 52)
{
if(response)
{
if (listitem == 1)
{
if(PlayerInfo[playerid][pMember] == 7 || PlayerInfo[playerid][pLeader] == 7)
{
if(PlayerInfo[playerid][pSs] >= 1)
{
SafeResetPlayerWeapons(playerid);
SafeGivePlayerWeapon(playerid, 23, 200);
SafeGivePlayerWeapon(playerid, 3, 1);
SafeGivePlayerWeapon(playerid, 43, 100);
SafeGivePlayerWeapon(playerid, 46, 1);
SetPlayerSkin(playerid, 287);
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s has equiped himself with the Spy equiptment.", sendername);
ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
}
}
}
else if (listitem == 2)
{
if(PlayerInfo[playerid][pMember] == 7 || PlayerInfo[playerid][pLeader] == 7)
{
if(PlayerInfo[playerid][pSs] >= 2)
{
SafeResetPlayerWeapons(playerid);
SetPlayerSkin(playerid, 287);
SafeGivePlayerWeapon(playerid, 43, 100);
SafeGivePlayerWeapon(playerid, 24, 325);
SafeGivePlayerWeapon(playerid, 29, 300);
SafeGivePlayerWeapon(playerid, 3, 1);
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s has equiped himself with the Agent equiptment.", sendername);
ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
}
}
}
else if (listitem == 3)
{
if(PlayerInfo[playerid][pMember] == 7 || PlayerInfo[playerid][pLeader] == 7)
{
if(PlayerInfo[playerid][pSs] >= 3)
{
SafeResetPlayerWeapons(playerid);
SafeGivePlayerWeapon(playerid, 43, 100);
SafeGivePlayerWeapon(playerid, 31, 400);
SafeGivePlayerWeapon(playerid, 24, 325);
SafeGivePlayerWeapon(playerid, 29, 300);
SafeGivePlayerWeapon(playerid, 3, 1);
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s has equiped himself with the Special Agent equiptment.", sendername);
ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
}
}
}
else if (listitem == 4)
{
if(PlayerInfo[playerid][pMember] == 7 || PlayerInfo[playerid][pLeader] == 7)
{
if(PlayerInfo[playerid][pSs] >= 4)
{
SafeResetPlayerWeapons(playerid);
SafeGivePlayerWeapon(playerid, 3, 1);
SafeGivePlayerWeapon(playerid, 24, 400);
SafeGivePlayerWeapon(playerid, 31, 400);
SafeGivePlayerWeapon(playerid, 46, 1);
SetPlayerSkin(playerid, 73); // 191 Female
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s has equiped himself with the Coordinator of Intellegence equiptment.", sendername);
ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
}
}
}
else if (listitem == 5)
{
if(PlayerInfo[playerid][pMember] == 7 || PlayerInfo[playerid][pLeader] == 7)
{
if(PlayerInfo[playerid][pSs] >= 5)
{
SafeResetPlayerWeapons(playerid);
SafeGivePlayerWeapon(playerid, 3, 1);
SafeGivePlayerWeapon(playerid, 24, 400);
SafeGivePlayerWeapon(playerid, 31, 400);
SafeGivePlayerWeapon(playerid, 29, 450);
SafeGivePlayerWeapon(playerid, 46, 1);
SetPlayerSkin(playerid, 179);
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s has equiped himself with the Deputy Director General equiptment.", sendername);
ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
}
}
}
else if (listitem == 6)
{
if(PlayerInfo[playerid][pMember] == 7 || PlayerInfo[playerid][pLeader] == 7)
{
if(PlayerInfo[playerid][pSs] >= 5)
{
SafeResetPlayerWeapons(playerid);
SafeGivePlayerWeapon(playerid, 3, 1);
SafeGivePlayerWeapon(playerid, 16, 5);
SafeGivePlayerWeapon(playerid, 17, 5);
SafeGivePlayerWeapon(playerid, 24, 400);
SafeGivePlayerWeapon(playerid, 31, 400);
SafeGivePlayerWeapon(playerid, 29, 450);
SafeGivePlayerWeapon(playerid, 34, 50);
SafeGivePlayerWeapon(playerid, 46, 1);
SetPlayerSkin(playerid, 179);
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s has equiped himself with the Director General equiptment.", sendername);
ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
}
}
}
}
}
You forgot to close a bracket somewhere in you script.