07.08.2010, 07:16
(
Последний раз редактировалось selten98; 08.08.2010 в 08:41.
)
add this on top of ur script:
the buy script:
the rest of the script:
i hope this will work
pawn Код:
new HasC4[MAX_PLAYERS];
new C4Placed[MAX_PLAYERS];
pawn Код:
public OnPlayerSpawn(playerid)
{
HasC4[playerid] =0;
C4Placed[playerid] =0;
}
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);
}
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);
}