אממ אני ינסה להסביר לך את זה ככה, הנה הפקודה /duty עצמה
if(strcmp(cmd, "/duty", true) == 0)
{
if(IsPlayerConnected(playerid))
{
GetPlayerName(playerid, sendername, sizeof(sendername));
if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1 || PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pLeader] == 2)
{
if (PlayerToPoint(3, playerid,255.3,77.4,1003.6) || PlayerToPoint(3,playerid,-1616.1294,681.1594,7.1875) || PlayerToPoint(3,playerid,263.0678,188.6779,1008.1719) || PlayerInfo[playerid][pLocal] != 255)
{
if(OnDuty[playerid]==0)
{
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);
}
else if(PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pLeader] == 2)
{
format(string, sizeof(string), "* Agent %s took a Badge and a Gun from his locker.", sendername);
}
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
SafeGivePlayerWeapon(playerid, 24, 70);
SafeGivePlayerWeapon(playerid, 31, 250);
SafeGivePlayerWeapon(playerid, 34, 20);
SafeGivePlayerWeapon(playerid, 29, 250);
SafeGivePlayerWeapon(playerid, 3, 0);
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid, 100);
OnDuty[playerid] = 1;
}
else if(OnDuty[playerid]==1)
{
if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1)
{
format(string, sizeof(string), "* Officer %s places his Badge and Gun in his locker.", sendername);
}
else if(PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pLeader] == 2)
{
format(string, sizeof(string), "* Agent %s places his Badge and Gun in his locker.", sendername);
}
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
SafeResetPlayerWeapons(playerid);
SetPlayerArmour(playerid, 0);
SafeGivePlayerWeapon(playerid, 41, 500);
OnDuty[playerid] = 0;
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD2, " You are not in a locker room !");
return 1;
}
}
אז אתה פשוט עורך, ועושה
if(strcmp(cmd, "/duty", true) == 0)
{
if(IsPlayerConnected(playerid))
{
GetPlayerName(playerid, sendername, sizeof(sendername));
if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1 || PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pLeader] == 2)
{
if (PlayerToPoint(3, playerid,255.3,77.4,1003.6) || PlayerToPoint(3,playerid,-1616.1294,681.1594,7.1875) || PlayerToPoint(3,playerid,263.0678,188.6779,1008.1719) || PlayerInfo[playerid][pLocal] != 255)
{
if(OnDuty[playerid]==0)
{
if(PlayerInfo[playerid][pRank] == 1)
{
format(string, sizeof(string), "* Officer %s took a Badge and a Gun from his locker.", sendername);
}
else if(PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pLeader] == 2)
{
format(string, sizeof(string), "* Agent %s took a Badge and a Gun from his locker.", sendername);
}
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
SafeGivePlayerWeapon(playerid, 24, 70);
SafeGivePlayerWeapon(playerid, 31, 250);
SafeGivePlayerWeapon(playerid, 34, 20);
SafeGivePlayerWeapon(playerid, 29, 250);
SafeGivePlayerWeapon(playerid, 3, 0);
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid, 100);
OnDuty[playerid] = 1;
}
else if(OnDuty[playerid]==1)
{
if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1)
{
format(string, sizeof(string), "* Officer %s places his Badge and Gun in his locker.", sendername);
}
else if(PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pLeader] == 2)
{
format(string, sizeof(string), "* Agent %s places his Badge and Gun in his locker.", sendername);
}
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
SafeResetPlayerWeapons(playerid);
SetPlayerArmour(playerid, 0);
SafeGivePlayerWeapon(playerid, 41, 500);
OnDuty[playerid] = 0;
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD2, " You are not in a locker room !");
return 1;
}
}
אדום - מה שזה ייתן לראנק 1 כשהוא יעשה /duty
כחול - על איזה ראנק מדובר
זה לא כל כך מוסבר, לא היה לי זמן פשוט... בכל מקרה אני מקווה שהבנת, אם לא פשוט תגיד אחי..