/stealbomb - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: /stealbomb (
/showthread.php?tid=435767)
/stealbomb -
Hand-Scripter - 08.05.2013
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?
Re: /stealbomb -
Faisal_khan - 08.05.2013
Change this to the other team:
pawn Код:
if(bombStolenBy != INVALID_PLAYER_ID)
Re: /stealbomb -
Hand-Scripter - 08.05.2013
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.
Re: /stealbomb -
Hand-Scripter - 08.05.2013
Problem Solved.