/bomb can use it just 3 time [How]
#1

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

any one please D: ?
Reply
#3

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.
Reply
#4

use this filterscript
Bomb system
Reply
#5

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
Reply
#6

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

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;
}

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)