08.05.2013, 13:49
Hello, I made a /stealbomb command but I have a question.
So, this is my code:
But I want that the millitairs (the other team) not able to steal the bomb. I tried a few things but it didn't seem to work. can anyone help me?
So, this is my code:
pawn Код:
CMD:stealbomb(playerid, params[])
{
if(IsPlayerInRangeOfPoint(playerid, 5.0, 275.3401, 1860.3333, 8.7578))
{
if(bombStolenBy != INVALID_PLAYER_ID)
{
GetPlayerName(bombStolenBy, str, MAX_PLAYER_NAME);
format(str, 128, "The bomb has already been stolen by %s!", str);
SendClientMessage(playerid, COLOR_RED, str);
return 1;
}
if(GetPlayerTeam(playerid) == Terrorists)
{
GetPlayerName(playerid, str, MAX_PLAYER_NAME);
format(str, 128, "%s has stolen the bomb!", str);
SendClientMessageToAll(COLOR_DARKORANGE, str);
bombStolenBy = playerid;
}
}
else return SendClientMessage(playerid, COLOR_RED, "You are not near the stealing point!");
return 1;
}