23.11.2012, 08:26
Hi, i would like to change so when you do /equip you automaticlly goes on duty but i dont know how so please tell me what i should do. here is the /equip
pawn Код:
if(strcmp(cmd, "/equip", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pDuty] == 0)
{
SendClientMessage(playerid,COLOR_GREY,"** You are not On Duty!");
return 1;
}
if(IsPlayerInRangeOfPoint(playerid, 6, 220.7051,74.7764,1005.0391) || IsPlayerInRangeOfPoint(playerid, 6,1456.9180,-1761.4631,3285.2859))
{
if(PlayerInfo[playerid][pMember] != 1 && PlayerInfo[playerid][pLeader] != 1) return SendClientMessage(playerid,COLOR_GREY,"** This Refill Point is Only for the SAPD");
new pdequip[] = "1\tCadet Equipment\n2\tOfficer Equipment\n3\tCorporal Equipment\n4\tBiker Equipment\n5\tSWAT Standard Equipment\n6\tSWAT Medium Equipment\n7\tSWAT Heavy Equipment\n8\tSWAT Sharpshooter Equipment\n9\tArmour+Health\n10\tSergeant Equipment\n11\tLieutenant Equipment\n12\tStandard Captain Equipment\n13\tStandard Deputy Chief Equipment\n14\tStandard Cheif Equipment";//i added
ShowPlayerDialog(playerid,50,DIALOG_STYLE_LIST,"List of Equips:",pdequip,"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, 1345.89,521.74,1067.76))//FBI Lockers (Library)
{
if(PlayerInfo[playerid][pMember] != 2 && PlayerInfo[playerid][pLeader] != 2)
{
SendClientMessage(playerid,COLOR_GREY,"** This Refill Point is Only for the FBI");
return 1;
}
new fbiequip[] = "1\tCadet Equipment\n2\tAgent Equipment\n3\tWatching Equipment\n4\tSpy Equipment\n5\tStandard Tactical\n6\tMedium Tactical\n7\tHeavy Tactical\n8\tSharpshooter Tactical\n9\tArmour+Health\n10\tCeremonial Suit\n11\tDefault\n12\tHigher Ranked";
ShowPlayerDialog(playerid,51,DIALOG_STYLE_LIST,"List of Equips:",fbiequip,"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, 1565.35,-1671.68,1723.10) || IsPlayerInRangeOfPoint(playerid, 6,-228.7514,980.0797,13.1000))
{
if(PlayerInfo[playerid][pMember] != 3 && PlayerInfo[playerid][pLeader] != 3)
{
SendClientMessage(playerid,COLOR_GREY,"** This Refill Point is Only Made For SASD ");
return 1;
}
new armyequip[] = "1\tCadet Equipment\n2\tSheriff Equipment\n3\tCorporal Equipment\n4\tSergeant Equipment\n5\tRegular Equipment\n6\tSpecial Equipment\n7\tMedium Equipment\n8\tLieutenant Equipment\n9\tArmour+Health\n10\tCaptain Equipment\n11\tDeputy Chief Equipment\n12\tChief Equipment";
ShowPlayerDialog(playerid,52,DIALOG_STYLE_LIST,"List of Equips:",armyequip,"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, 233.5712,124.9033,1003.2188) || IsPlayerInRangeOfPoint(playerid, 6,203.5945,1869.5051,13.1406) || IsPlayerInRangeOfPoint(playerid, 6,-1342.0365,494.2091,11.1953))
{
if(PlayerInfo[playerid][pMember] != 12 && PlayerInfo[playerid][pLeader] != 12)
{
SendClientMessage(playerid,COLOR_GREY,"** This Refill Point is Only for the Army");
return 1;
}
new armyequip12[] = "1\tPrivate Equipment\n2\tSergeant Equipment\n3\tWatching Equipment\n4\tSpy Equipment\n5\tStandard Special Forces\n6\tMedium Special Forces\n7\tHeavy Special Forces\n8\tHeaviest Tactical\n9\tArmour+Health\n10\tCeremonial Suit\n11\tDefault\n12\tHigher Ranked";
ShowPlayerDialog(playerid,31000,DIALOG_STYLE_LIST,"List of Equips:",armyequip12,"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, 354.1535,155.0970,1025.7964))
{
if(PlayerInfo[playerid][pMember] != 7 && PlayerInfo[playerid][pLeader] != 7)
{
SendClientMessage(playerid,COLOR_GREY,"** This Refill Point is Only for the Goverments");
return 1;
}
new armyequip7[] = "1\tSecurity\n2\tHigher Rank Equipment\n3\tArmour+Health";
ShowPlayerDialog(playerid,31001,DIALOG_STYLE_LIST,"List of Equips:",armyequip7,"Select","Cancel");
SendClientMessage(playerid, COLOR_GREY,"* REMEMBER, You may not be able to Select EVERYTHING, Each Item needs it's Specified Rank!");
}
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;
}
return 1;
}