/stealbomb
#1

Hello, I made a /stealbomb command but I have a question.

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;
}
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?
Reply
#2

Change this to the other team:
pawn Код:
if(bombStolenBy != INVALID_PLAYER_ID)
Reply
#3

Quote:
Originally Posted by Faisal_khan
Посмотреть сообщение
Change this to the other team:
pawn Код:
if(bombStolenBy != INVALID_PLAYER_ID)
Only 1 person can steal the bomb, if he dies the bomb will be reseted. If I change that every terrorist would be able to steal the bomb.
Reply
#4

Problem Solved.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)