Код:
if(strcmp(cmd, "/claim", true) == 0)
{
new mypoint = -1;
GetPlayerName(playerid, playername, sizeof(playername));
if (PlayerInfo[playerid][pFMember] >= MAX_FAMILY || PlayerInfo[playerid][pRank] < 5)
{
SendClientMessage(playerid, COLOR_GRAD2, "Only family Boss and Underboss can claim");
return 1;
}
for (i=0; i<MAX_POINTS; i++)
{
if (PlayerToPoint(2.0, playerid, 403.5565,2454.8381,16.5000)) mypoint = i;
}
if (mypoint == -1)
{
SendClientMessage(playerid, COLOR_GRAD2, "You are not at any point that can be claimed");
return 1;
}
if (Points[mypoint][Vulnerable] > 0)
{
SendClientMessage(playerid, COLOR_GRAD2, "This point is not ready for takeover");
return 1;
}
if (Points[mypoint][ClaimerId] != 255)
{
SendClientMessage(playerid, COLOR_GRAD2, "This point is already being claimed by someone else, eliminate him first!");
return 1;
}
format(string, sizeof(string), "%s is trying to claim %s, waste him!", playername, Points[mypoint][Name]);
SendClientMessageToAll(TEAM_ORANGE_COLOR, string);
format(string, sizeof(string), "You must stand here for 10-20 seconds to claim");
SendClientMessage(playerid, COLOR_WHITE, string);
Points[mypoint][ClaimerId] = playerid;
Points[mypoint][TimeToClaim] = 2;
Points[mypoint][TakeOverTimerStarted] = 0;
Points[mypoint][BeingClaimed] = 1;
//Points[mypoint][ClaimerTeam] = PlayerInfo[playerid][pFMember];
return 1;
}