18.12.2010, 07:39
Quote:
Well I've been working on my first ever script & from scratch and I've stumbled into a problem
pawn Код:
|
pawn Код:
new BombSpamPlayer[MAX_PLAYERS];
forward BombSpam(playerid);
pawn Код:
public BombSpam(playerid)
{
if(BombSpamPlayer[playerid] == 1)
{
BombSpamPlayer[playerid] = 0;
return 1;
}
return 1;
}
pawn Код:
if(strcmp("/bomb", cmdtext, true, 10) == 0)
{
if(GetPlayerMoney(playerid) < 2500) return SendClientMessage(playerid,_COLOR_GREY,"You need $2,500 for this!");
if(BombSpamPlayer[playerid] == 1) return SendClientMessage(playerid,_COLOR_GREY, "You can use this command every 30 seconds!"); // Added this
if (gTeam[playerid] == TEAM_TERRORIST)
{
new Float:X,Float:Y,Float:Z;
GetPlayerPos(playerid,X,Y,Z);
CreateExplosion(X,Y,Z,6,40.0);
SetPlayerHealth(playerid, 0.0);
GivePlayerMoney(playerid, -500);
GameTextForPlayer(playerid,"~r~SUPRISE BLOWUP!",2500,5);
SendClientMessage(playerid, _COLOR_RED, "You commited suicide and lost an extra $500!");
BombSpamPlayer[playerid] = 1; // Added this
SetTimerEx("BombSpam", 5000, 0, "i", playerid); // Added a timer for a player only. 5000 milliseconds is 5 seconds.
}
return 1;
}