SA-MP Forums Archive
/bomb can use it just 3 time [How] - 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: /bomb can use it just 3 time [How] (/showthread.php?tid=341017)



/bomb can use it just 3 time [How] - [D]ry[D]esert - 09.05.2012

Hello
How can i make player can use any command for example /bomb just 3 times ? And /warn max warns is 3 ?


Re: /bomb can use it just 3 time [How] - [D]ry[D]esert - 09.05.2012

any one please D: ?


Re: /bomb can use it just 3 time [How] - TzAkS. - 09.05.2012

Make a variable and add it to a command ex:
Код:
new Variable[MAX_PLAYERS];
Код:
if (strcmp("/cmd", cmdtext, true, 10) == 0)
{
if(Variable[playerid] == 3)
{
SendClientMessage(playerid, -1, "You can use this command just 3 times");
}
//do something
Variable[playerid] += 1;
}
This is just an example.


Re: /bomb can use it just 3 time [How] - Skaizo - 09.05.2012

use this filterscript
Bomb system


Re: /bomb can use it just 3 time [How] - [D]ry[D]esert - 09.05.2012

Quote:
Originally Posted by TzAkS.
Посмотреть сообщение
Make a variable and add it to a command ex:
Код:
new Variable[MAX_PLAYERS];
Код:
if (strcmp("/cmd", cmdtext, true, 10) == 0)
{
if(Variable[playerid] == 3)
{
SendClientMessage(playerid, -1, "You can use this command just 3 times");
}
//do something
Variable[playerid] += 1;
}
This is just an example.
Quote:
Originally Posted by Skaizo
Посмотреть сообщение
use this filterscript
Thanks + Rep That what i need :P
Bomb system
I said i want Make 3 Time not Bomb System Wa Ever Thanks and Rep For At least Answer me :P


Re: /bomb can use it just 3 time [How] - john_jenkins - 09.05.2012

get bomd system and download it https://sampforum.blast.hk/showthread.php?tid=175669


Re: /bomb can use it just 3 time [How] - DamienWalter - 15.05.2012

Try This
Quote:

CMD:bomb(playerid, params[])
{
if(C4Enabled == 0) return 1;
if (PlayerInfo[playerid][pMember] == 0 || PlayerInfo[playerid][pLeader] ==
{
if (PlayerInfo[playerid][pC4] == 0)
{
if (PlayerInfo[playerid][pBombs] != 0)
{
if(IsPlayerInAnyVehicle(playerid))
{
SendClientMessageEx(playerid, COLOR_LIGHTRED,"You can't plant C4 while in a vehicle!");
return 1;
}
GetPlayerPos(playerid,Positions[0][0], Positions[0][1], Positions[0][2]);
SetPVarFloat(playerid, "DYN_C4_FLOAT_X", Positions[0][0]);
SetPVarFloat(playerid, "DYN_C4_FLOAT_Y", Positions[0][1]);
SetPVarFloat(playerid, "DYN_C4_FLOAT_Z", Positions[0][2]);
PlayerInfo[playerid][pC4] = CreateDynamicObject(1654, Positions[0][0], Positions[0][1], Positions[0][2]-0.9, 0, 89.325012207031, 3.9700012207031);
ApplyAnimation(playerid,"BOMBER","BOM_Plant",4.0,0 ,0,0,0,0);
ApplyAnimation(playerid,"BOMBER","BOM_Plant",4.0,0 ,0,0,0,0);
SendClientMessageEx(playerid, COLOR_GREEN, "You have placed C4 on the ground, /pickupbomb to remove it.");
//PlayerInfo[playerid][pC4] = 3;
PlayerInfo[playerid][pBombs]--;
PlayerInfo[playerid][pC4Used] = 3;
}
else
{
SendClientMessageEx(playerid, COLOR_GRAD2, "You do not have C4!");
return 1;
}
}
else
{
SendClientMessageEx(playerid, COLOR_GRAD2, " You can only deploy 1 C4 at a time ! ");
return 1;
}
}
else
{
SendClientMessageEx(playerid, COLOR_GRAD2, " text here ! ");
}
return 1;
}