PHP код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
if (pickupid == bFlag)
{
SendClientMessage(playerid, 0xF00000,"You picked up blue bag");
if (gTeam[playerid] == TEAM_BLUE)
{
returner[playerid] = true;
returnedB = true;
Returned(playerid);
DestroyPickup(bFlag);
}
if (gTeam[playerid] == TEAM_RED)
{
DestroyPickup(bFlag);
new name[MAX_PLAYER_NAME], string[24+MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "%s(Red) picked the bag", name);
SendClientMessageToAll(0xC4C4C4FF, string);
theif[playerid] = true;
DestroyPickup(bFlag);
if (helped[playerid] == true)
{
helped[playerid] = false;
}
}
}
else if (pickupid == rFlag)
{
SendClientMessage(playerid, 0xF00000,"You picked up red bag");
if (gTeam[playerid] == TEAM_BLUE)
{
new name[MAX_PLAYER_NAME], string[24+MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "%s(Blue) picked the bag", name);
SendClientMessageToAll(0xC4C4C4FF, string);
theif[playerid] = true;
DestroyPickup(rFlag);
if (helped[playerid] == true)
{
helped[playerid] = false;
}
}
if (gTeam[playerid] == TEAM_RED)
{
returner[playerid] = true;
returnedR = true;
Returned(playerid);
DestroyPickup(rFlag);
}
}
return 1;
}