Car Bomb
#3

add this on top of ur script:
pawn Код:
new HasC4[MAX_PLAYERS];
new C4Placed[MAX_PLAYERS];
pawn Код:
public OnPlayerSpawn(playerid)
{
  HasC4[playerid] =0;
  C4Placed[playerid] =0;
}
the buy script:
pawn Код:
public OnPlayerEnterCheckpoint(playerid)//or something else
{
  if(HasC4[playerid] =1)
  {
    SendClientMessage(playerid,COLOR_RED,"You already own C4");
  }
  if(cash >= 14999)
  {
     SendClientMessage(playerid,COLOR_RED,"You Don't have enough cash");
   }
  HasC4[playerid] =1;
  GivePlayerMoney(playerid, -15000);
}
the rest of the script:
pawn Код:
if(!strcmp(cmd,"/placeC4",true))
{
   if(IsPlayerInVehicleAnyVehicle(playerid))
   {
      new bomb, Float:x,Float:y,Float:z;
      bomb = IsValidObject(1252);
      GetPlayerPos(playerid,x,y,z);
      CreateObject(bomb,x,y,z+1,0,0,0);
      HasC4[playerid] =0;
      C4Placed[playerid] =1;
   }
}
if(!strcmp(cmd,"/detonateC4",true))
{
if(C4Placed[playerid] =0)
  {
     SendClientMessage(playerid,COLOR_RED,"You Haven't placed C4");
  }
   new bomb - IsValidObject(1252);
   new Float:bx,Float:by,Float:bz;
   GetObjectPos(bomb,bx,by,bz);
   CreateExplosion(bx,by,bz+1,7,10);
   DestroyObject(bomb);
   C4Placed[playerid] =0);
}
i hope this will work
Reply


Messages In This Thread
Car Bomb - by Kevin_Joshen - 07.08.2010, 05:12
Re: Car Bomb - by GangsTa_ - 07.08.2010, 05:55
Re: Car Bomb - by selten98 - 07.08.2010, 07:16
Re: Car Bomb - by selten98 - 07.08.2010, 11:43
Re: Car Bomb - by Kevin_Joshen - 08.08.2010, 02:26
Re: Car Bomb - by Kar - 08.08.2010, 02:32
Re: Car Bomb - by Kevin_Joshen - 08.08.2010, 03:19
Re: Car Bomb - by Kar - 08.08.2010, 03:58
Re: Car Bomb - by Ritchie999 - 08.08.2010, 04:01
Re: Car Bomb - by Kevin_Joshen - 08.08.2010, 04:12

Forum Jump:


Users browsing this thread: 2 Guest(s)