++Rep For Helping Me
#1

Hello Guys
i Tired To Make #Script For Robmission
about script || [this the old Topic no one helping me] [http://forum.sa-mp.com/showthread.ph...23#post3855223] || 1.Take All Pickups || 2.After Take The Pickups<< Appear To Him Checkpoints For Finish ||
3.He is in Checkpoints Take The Reward <<
and i search much time and i got this FS > but have some problems
My Problems > i Tired To Delete Every Thing and put only [CMD:emptydeposit(playerid, params[])] + pickups + time from this FS > i Failed to take all of them
now i just need somone help me please please
for only using this cmd with timer and pickups and coords for pickup and checkpoints
+Rep i swear || this the script i mean it
Thanks,
PHP код:
#define     FILTERSCRIPT
#include     <a_samp>
#include    <streamer>
#include    <zcmd>
#define     VAULT_VIRTUALWORLD      (69)
#define     PICKUP_COOLDOWN         (3)
#define     DEPOSIT_MIN             (3500)
#define     DEPOSIT_MAX             (10000)
enum    e_objecttypes
{
    
TYPE_LASER1 2,
    
TYPE_LASER2,
    
TYPE_LASER3,
    
TYPE_VAULTDOOR 6
};
enum     e_labeltypes
{
    
Text3DTYPE_KEYPAD,
    
Text3DTYPE_EXPLOSIVE,
    
Text3DTYPE_TIMELOCK
};
enum    e_bankcontrols
{
    
boolAlarm,
    
boolLasersOn,
    
VaultDoorState,
    
KeypadHackTime,
    
DoorInteractionTime
};
new
    
BankEntryPickup = -1BankExitPickup = -1VaultEntryPickup = -1VaultExitPickup = -1,
    
AlarmArea = -1,
    
VaultObjects[8] = {INVALID_OBJECT_ID, ...},
    
Text3DVaultLabels[e_labeltypes] = {Text3DINVALID_3DTEXT_ID, ...},
    
Text3DInsideVaultLabels[8] = {Text3DINVALID_3DTEXT_ID, ...},
    
BankControls[e_bankcontrols],
    
boolDepositRobbed[8];
    
new
    
RobberyTimer[MAX_PLAYERS] = {-1, ...},
    
RobberyCounter[MAX_PLAYERS],
    
RobberyType[MAX_PLAYERS],
    
RobberyCash[MAX_PLAYERS],
    
RobberyEscape[MAX_PLAYERS] = {-1, ...};
new
    
FloatDepositCoords[8][3] = {
        {
2141.92551629.3380993.5761},
        {
2141.92551633.2180993.5761},
        {
2141.92551637.0980993.5761},
        {
2141.92551640.9780993.5761},
        {
2146.56001629.3040993.5761},
        {
2146.56001633.1840993.5761},
        {
2146.56001637.0640993.5761},
        {
2146.56001640.9440993.5761}
    };
    
new
    
FloatGetawayLocations[][3] = {
        {
405.46492451.495616.5000},
        {-
1647.89812497.698086.2031},
        {-
911.9169, -498.311225.9609}
    };
forward RobberyUpdate(playerid);
forward ResetLasers();
forward OpenVaultDoor(typeseconds);
forward ResetVaultDoor();
forward DisableAlarm();
stock ConvertToMinutes(time)
{
    
// https://sampforum.blast.hk/showthread.ph...2.84316246
    
new string[15];//-2000000000:00 could happen, so make the string 15 chars to avoid any errors
    
format(stringsizeof(string), "%02d:%02d"time 60time 60);
    return 
string;
}
stock ResetRobbery(playeriddestroy 0)
{
    if(
RobberyTimer[playerid] != -1KillTimer(RobberyTimer[playerid]);
    
RobberyTimer[playerid] = -1;
    
RobberyCounter[playerid] = 0;
    
RobberyType[playerid] = 0;
    if(
destroy)
    {
        if(
IsValidDynamicCP(RobberyEscape[playerid])) DestroyDynamicCP(RobberyEscape[playerid]);
        
RobberyEscape[playerid] = -1;
        
RobberyCash[playerid] = 0;
    }
    
    return 
1;
}
stock GetClosestDeposit(playeridFloatrange 2.0)
{
    new 
id = -1Floatdist rangeFloattempdist;
    for(new 
isizeof(DepositCoords); ++i)
    {
        
tempdist GetPlayerDistanceFromPoint(playeridDepositCoords[i][0], DepositCoords[i][1], DepositCoords[i][2]);
        if(
tempdist range) continue;
        if(
tempdist <= dist)
        {
            
dist tempdist;
            
id i;
            break;
        }
    }
    
    return 
id;
}
stock RandomEx(minmax)
    return 
random(max min) + min;
stock TriggerAlarm(reason 0)
{
    if(
BankControls[Alarm]) return 1;
    for(new 
iGetMaxPlayers(); ++i)
    {
        if(!
IsPlayerConnected(i)) continue;
        if(
RobberyType[i] == 1)
        {
            
ResetRobbery(i);
            
ClearAnimations(i1);
        }
        
        if(!
GetPVarInt(i"InsideBank")) continue;
        
SetPVarInt(i"Alarm"1);
        
PlayerPlaySound(i34010.00.00.0);
    }
    
    
SetTimer("DisableAlarm"120000false);
    
BankControls[Alarm] = true;
    
SendClientMessageToAll(-1, (reason == 1) ? ("Bank security heard an explosion in the vault room!") : ("Bank security detected criminals in the vault room!"));
    return 
1;
}
public 
OnFilterScriptInit()
{
    
BankEntryPickup CreatePickup(1919712303.1777, -16.162527.0);
    
BankExitPickup CreatePickup(1919712305.5591, -16.125327.0, -1);
    
VaultEntryPickup CreatePickup(1919712315.5637, -0.144927.0, -1);
    
VaultExitPickup CreatePickup(1919712144.27881602.5975998.0VAULT_VIRTUALWORLD);
    
    
AlarmArea CreateDynamicRectangle(2130.61691607.90102156.9197,1625.2343VAULT_VIRTUALWORLD1);
    
    
VaultObjects[0] = CreateDynamicObject(194462144.3331601.4751001.38790.00090.1990.000VAULT_VIRTUALWORLD); // wall
    
VaultObjects[1] = CreateDynamicObject(29472145.0371601.421996.7760.0000.000, -89.500VAULT_VIRTUALWORLD); // door
    
VaultObjects[TYPE_LASER1] = CreateDynamicObject(186432142.9831606.679993.1880.0000.0000.000VAULT_VIRTUALWORLD); // laser
    
VaultObjects[TYPE_LASER2] = CreateDynamicObject(186432142.9831606.679993.9380.0000.0000.000VAULT_VIRTUALWORLD); // laser
    
VaultObjects[TYPE_LASER3] = CreateDynamicObject(186432142.9831606.679994.6880.0000.0000.000VAULT_VIRTUALWORLD); // laser
    
VaultObjects[5] = CreateDynamicObject(192732146.1161604.895994.1180.0000.000270.000VAULT_VIRTUALWORLD); // keypad
    
VaultObjects[TYPE_VAULTDOOR] = CreateDynamicObject(197992143.1851626.965994.2980.000, -0.400, -180.000VAULT_VIRTUALWORLD); // vault door
    
VaultObjects[7] = CreateDynamicObject(29222140.3611626.826993.9780.0000.000180.000VAULT_VIRTUALWORLD); // timelock
    
VaultLabels[TYPE_KEYPAD] = CreateDynamic3DTextLabel("Keypad\n{FFFFFF}/starthack to disable lasers"0xF39C12FF2145.851604.9456993.568415.0, .testlos 1, .worldid VAULT_VIRTUALWORLD);
    
VaultLabels[TYPE_EXPLOSIVE] = CreateDynamic3DTextLabel("Vault Door - Option 1\n{FFFFFF}/plantbomb to blow up vault door (fast & loud)"0xF39C12FF2144.16241626.25993.688210.0, .testlos 1, .worldid VAULT_VIRTUALWORLD);
    
VaultLabels[TYPE_TIMELOCK] = CreateDynamic3DTextLabel("Vault Door - Option 2\n{FFFFFF}/timelock to start time lock (slow & silent)"0xF39C12FF2140.26101626.25993.688210.0, .testlos 1, .worldid VAULT_VIRTUALWORLD);
    for(new 
isizeof(InsideVaultLabels); ++i)
    {
        
InsideVaultLabels[i] = CreateDynamic3DTextLabel("Deposit Boxes\n{FFFFFF}/emptydeposit"0x2ECC71FFDepositCoords[i][0], DepositCoords[i][1], DepositCoords[i][2], 15.0, .testlos 1, .worldid VAULT_VIRTUALWORLD);
    }
    
BankControls[LasersOn] = true;
    return 
1;
}
public 
OnFilterScriptExit()
{
    
DestroyPickup(BankEntryPickup);
    
DestroyPickup(BankExitPickup);
    
DestroyPickup(VaultEntryPickup);
    
DestroyPickup(VaultExitPickup);
    for(new 
iGetMaxPlayers(); ++i)
    {
        if(!
IsPlayerConnected(i)) continue;
        if(
GetPVarInt(i"Alarm"))
        {
              
SetPVarInt(i"Alarm"0);
            
PlayerPlaySound(i34020.00.00.0);
        }
        
        
ClearAnimations(i1);
        
ResetRobbery(i1);
     }
     
    return 
1;
}
public 
OnPlayerDisconnect(playeridreason)
{
    
ResetRobbery(playerid1);
    return 
1;
}
public 
OnPlayerDeath(playeridkilleridreason)
{
    
ResetRobbery(playerid1);
    return 
1;
}
public 
OnPlayerPickUpPickup(playeridpickupid)
{
    if(
GetPVarInt(playerid"BankPickupCooldown") > gettime()) return 1;
    if(
pickupid == BankEntryPickup) {
        
SetPVarInt(playerid"InsideBank"1);
         
SetPlayerPos(playerid2305.5591, -16.125326.7496);
           
SetPVarInt(playerid"BankPickupCooldown"gettime() + PICKUP_COOLDOWN);
           
           if(
BankControls[Alarm])
        {
            
SetPVarInt(playerid"Alarm"1);
            
PlayerPlaySound(playerid34010.00.00.0);
        }
    }else if(
pickupid == BankExitPickup) {
        
SetPVarInt(playerid"InsideBank"0);
         
SetPlayerPos(playerid2303.1777, -16.162526.4844);
           
SetPVarInt(playerid"BankPickupCooldown"gettime() + PICKUP_COOLDOWN);
           
        if(
GetPVarInt(playerid"Alarm"))
        {
            
SetPVarInt(playerid"Alarm"0);
            
PlayerPlaySound(playerid34020.00.00.0);
        }
           
           if(
RobberyCash[playerid] > && !IsValidDynamicCP(RobberyEscape[playerid]))
           {
               new 
id random(sizeof(GetawayLocations));
               
RobberyEscape[playerid] = CreateDynamicCP(GetawayLocations[id][0], GetawayLocations[id][1], GetawayLocations[id][2], 3.0, .playerid playerid, .streamdistance 5000.0);
               
SendClientMessage(playerid, -1"Go to the marked location to get your money. If you die you'll lose it.");
           }
    }else if(
pickupid == VaultEntryPickup) {
        if(!
GetPVarInt(playerid"animsloaded"))
        {
            
ApplyAnimation(playerid"BOMBER""null"0.000000);
            
ApplyAnimation(playerid"COP_AMBIENT""null"0.000000);
            
ApplyAnimation(playerid"ROB_BANK""null"0.000000);
            
SetPVarInt(playerid"animsloaded"1);
        }
        
        
SetPlayerInterior(playerid1);
        
SetPlayerVirtualWorld(playeridVAULT_VIRTUALWORLD);
        
SetPlayerPos(playerid2144.27881602.5975997.7766);
           
SetPVarInt(playerid"BankPickupCooldown"gettime() + PICKUP_COOLDOWN);
    }else if(
pickupid == VaultExitPickup) {
        
SetPlayerInterior(playerid0);
        
SetPlayerVirtualWorld(playerid0);
        
SetPlayerPos(playerid2315.5637, -0.144926.7422);
           
SetPVarInt(playerid"BankPickupCooldown"gettime() + PICKUP_COOLDOWN);
    }
    
    return 
1;
}
public 
OnPlayerEnterDynamicArea(playeridareaid)
{
    if(
areaid == AlarmArea && BankControls[LasersOn] && !BankControls[Alarm]) TriggerAlarm();
    return 
1;
}
public 
OnPlayerEnterDynamicCP(playeridcheckpointid)
{
    if(
checkpointid == RobberyEscape[playerid])
    {
        new 
string[128];
        
format(stringsizeof(string), "Robbery successful! You've robbed {2ECC71}$%d."RobberyCash[playerid]);
        
SendClientMessage(playerid, -1string);
        
        
GivePlayerMoney(playeridRobberyCash[playerid]);
        
RobberyCash[playerid] = 0;
        
DestroyDynamicCP(RobberyEscape[playerid]);
        
RobberyEscape[playerid] = -1;
    }
    
    return 
1;
}
public 
RobberyUpdate(playerid)
{
    if(
RobberyCounter[playerid] > 1) {
        
RobberyCounter[playerid]--;
         new 
string[32];
        switch(
RobberyType[playerid])
        {
            case 
1format(stringsizeof(string), "~w~Hacking: %s%d", (RobberyCounter[playerid] <= 5) ? ("~r~~h~") : ("~y~"), RobberyCounter[playerid]);
            case 
2format(stringsizeof(string), "~w~Emptying: %s%d", (RobberyCounter[playerid] <= 3) ? ("~r~~h~") : ("~y~"), RobberyCounter[playerid]);
        }
        
GameTextForPlayer(playeridstring10004);
    }else if(
RobberyCounter[playerid] == 1) {
        switch(
RobberyType[playerid])
        {
            case 
1:
            {
                
BankControls[LasersOn] = false;
                
SetDynamicObjectPos(VaultObjects[TYPE_LASER1], 2142.9831606.679990.0);
                
SetDynamicObjectPos(VaultObjects[TYPE_LASER2], 2142.9831606.679990.0);
                
SetDynamicObjectPos(VaultObjects[TYPE_LASER3], 2142.9831606.679990.0);
                
SetTimer("ResetLasers"240000false);
                
SendClientMessage(playerid, -1"You've disabled the lasers. Now you can go to the vault door without raising the alarm.");
                
SendClientMessage(playerid, -1"Lasers will turn back on in 4 minutes.");
            }
            case 
2:
            {
                new 
cash RandomEx(DEPOSIT_MINDEPOSIT_MAX), string[128];
                if(
BankControls[VaultDoorState] == 2cash -= floatround(cash 0.1floatround_floor); // explosion damaged deposit boxes, 10% damage penalty
                
RobberyCash[playerid] += cash;
                
format(stringsizeof(string), "You've emptied a set of deposit boxes and stole {2ECC71}$%d {FFFFFF}worth of stuff."cash);
                
SendClientMessage(playerid, -1string);
                
SendClientMessage(playerid, -1"You can leave the bank to get your money or keep robbing.");
            }
        }
        
ClearAnimations(playerid1);
        
ResetRobbery(playerid);
    }
    return 
1;
}
public 
ResetLasers()
{
    
BankControls[LasersOn] = true;
    
SetDynamicObjectPos(VaultObjects[TYPE_LASER1], 2142.9831606.679993.188);
    
SetDynamicObjectPos(VaultObjects[TYPE_LASER2], 2142.9831606.679993.938);
    
SetDynamicObjectPos(VaultObjects[TYPE_LASER3], 2142.9831606.679994.688);
    if(
IsAnyPlayerInDynamicArea(AlarmArea1)) TriggerAlarm();
    return 
1;
}
public 
OpenVaultDoor(typeseconds)
{
    if(
seconds 1) {
        
seconds--;
        new 
string[128];
        switch(
type)
        {
            case 
2format(stringsizeof(string), "Vault Door - Option 1\n{FFFFFF}/plantbomb to blow up vault door (fast & loud)\n{2ECC71}%s"ConvertToMinutes(seconds));
            case 
3format(stringsizeof(string), "Vault Door - Option 2\n{FFFFFF}/timelock to start time lock (slow & silent)\n{2ECC71}%s"ConvertToMinutes(seconds));
        }
        
UpdateDynamic3DTextLabelText((type == 2) ? VaultLabels[TYPE_EXPLOSIVE] : VaultLabels[TYPE_TIMELOCK], 0xF39C12FFstring);
        
SetTimerEx("OpenVaultDoor"1000false"ii"typeseconds);
    }else if(
seconds == 1) {
        
BankControls[VaultDoorState] = type;
        
SetTimer("ResetVaultDoor"120000false);
        switch(
type)
        {
            case 
2:
            {
                
// explosive
                
CreateExplosion(2144.16241626.25993.6882115.0);
                
SetDynamicObjectPos(VaultObjects[TYPE_VAULTDOOR], 2143.1851626.965985.298);
                
UpdateDynamic3DTextLabelText(VaultLabels[TYPE_EXPLOSIVE], 0xF39C12FF"Vault Door - Option 1\n{FFFFFF}/plantbomb to blow up vault door (fast & loud)");
                
TriggerAlarm(1);
            }
            case 
3:
            {
                
// timelock
                
MoveDynamicObject(VaultObjects[TYPE_VAULTDOOR], 2143.1851626.965994.350.010.000, -0.400, -270.0);
                
UpdateDynamic3DTextLabelText(VaultLabels[TYPE_TIMELOCK], 0xF39C12FF"Vault Door - Option 2\n{FFFFFF}/timelock to start time lock (slow & silent)");
            }
        }
    }
    return 
1;
}
public 
ResetVaultDoor()
{
    switch(
BankControls[VaultDoorState])
    {
        case 
2SetDynamicObjectPos(VaultObjects[TYPE_VAULTDOOR], 2143.1851626.965994.298);
        case 
3MoveDynamicObject(VaultObjects[TYPE_VAULTDOOR], 2143.1851626.965994.2980.010.000, -0.400, -180.0);
    }
    for(new 
isizeof(DepositCoords); ++i)
    {
        
DepositRobbed[i] = false;
        
Streamer_SetIntData(STREAMER_TYPE_3D_TEXT_LABELInsideVaultLabels[i], E_STREAMER_COLOR0x2ECC71FF);
    }
    
    
BankControls[VaultDoorState] = 0// closed
    
return 1;
}
public 
DisableAlarm()
{
    
BankControls[Alarm] = false;
    for(new 
iGetMaxPlayers(); ++i)
    {
        if(!
IsPlayerConnected(i)) continue;
        if(!
GetPVarInt(i"Alarm")) continue;
          
SetPVarInt(i"Alarm"0);
        
PlayerPlaySound(i34020.00.00.0);
    }
    return 
1;
}
CMD:starthack(playeridparams[])
{
    if(!
IsPlayerInRangeOfPoint(playerid1.52145.851604.9456993.5684)) return SendClientMessage(playerid0xE74C3CFF"ERROR: {FFFFFF}You're not near the keypad.");
    if(
BankControls[Alarm]) return SendClientMessage(playerid0xE74C3CFF"ERROR: {FFFFFF}Alarm went off, you can't hack the keypad.");
    if(!
BankControls[LasersOn]) return SendClientMessage(playerid0xE74C3CFF"ERROR: {FFFFFF}Keypad has been hacked already.");
    if(
BankControls[KeypadHackTime] > gettime())
    {
        new 
string[72];
        
format(stringsizeof(string), "ERROR: {FFFFFF}You have to wait %s to hack the keypad again."ConvertToMinutes(BankControls[KeypadHackTime] - gettime()));
         
SendClientMessage(playerid0xE74C3CFFstring);
        return 
1;
    }
    
    
ApplyAnimation(playerid"COP_AMBIENT""COPBROWSE_LOOP"4.1100001);
    
BankControls[KeypadHackTime] = gettime() + 600;
    
RobberyType[playerid] = 1;
    
RobberyCounter[playerid] = 20;
    
RobberyTimer[playerid] = SetTimerEx("RobberyUpdate"1000true"i"playerid);
    return 
1;
}
CMD:plantbomb(playeridparams[])
{
    if(!
IsPlayerInRangeOfPoint(playerid1.52144.16241626.25993.6882)) return SendClientMessage(playerid0xE74C3CFF"ERROR: {FFFFFF}You're not near the vault door.");
    if(
BankControls[VaultDoorState] != 0) return SendClientMessage(playerid0xE74C3CFF"ERROR: {FFFFFF}Vault door is already open/opening.");
    if(
BankControls[DoorInteractionTime] > gettime())
    {
        new 
string[72];
        
format(stringsizeof(string), "ERROR: {FFFFFF}You have to wait %s to open the vault door again."ConvertToMinutes(BankControls[DoorInteractionTime] - gettime()));
         
SendClientMessage(playerid0xE74C3CFFstring);
        return 
1;
    }
    
    
ApplyAnimation(playerid"BOMBER""BOM_Plant"4.1011001);
    
BankControls[DoorInteractionTime] = gettime() + 600;
    
BankControls[VaultDoorState] = 1// opening
    
SetTimerEx("OpenVaultDoor"1000false"ii"26);
    
SendClientMessage(playerid, -1"Bomb has been planted and it'll explode in 6 seconds. Take cover!");
    return 
1;
}
CMD:timelock(playeridparams[])
{
    if(!
IsPlayerInRangeOfPoint(playerid1.52140.26101626.25993.6882)) return SendClientMessage(playerid0xE74C3CFF"ERROR: {FFFFFF}You're not near the time lock.");
    if(
BankControls[Alarm]) return SendClientMessage(playerid0xE74C3CFF"ERROR: {FFFFFF}Time lock disabled because of alarm.");
    if(
BankControls[VaultDoorState] != 0) return SendClientMessage(playerid0xE74C3CFF"ERROR: {FFFFFF}Vault door is already open/opening.");
    if(
BankControls[DoorInteractionTime] > gettime())
    {
        new 
string[72];
        
format(stringsizeof(string), "ERROR: {FFFFFF}You have to wait %s to open the vault door again."ConvertToMinutes(BankControls[DoorInteractionTime] - gettime()));
         
SendClientMessage(playerid0xE74C3CFFstring);
        return 
1;
    }
    
BankControls[DoorInteractionTime] = gettime() + 600;
    
BankControls[VaultDoorState] = 1// opening
    
SetTimerEx("OpenVaultDoor"1000false"ii"330);
    
SendClientMessage(playerid, -1"You've started the time lock, vault door will open in 30 seconds.");
    return 
1;
}
CMD:emptydeposit(playeridparams[])
{
    if(
BankControls[VaultDoorState] < 2) return SendClientMessage(playerid0xE74C3CFF"ERROR: {FFFFFF}You can't empty deposit boxes when the vault door isn't open.");
    new 
id GetClosestDeposit(playerid);
    if(
id == -1) return SendClientMessage(playerid0xE74C3CFF"ERROR: {FFFFFF}You're not near any deposit boxes.");
    if(
DepositRobbed[id]) return SendClientMessage(playerid0xE74C3CFF"ERROR: {FFFFFF}Deposit boxes you're trying to rob are already robbed.");
    
DepositRobbed[id] = true;
    
Streamer_SetIntData(STREAMER_TYPE_3D_TEXT_LABELInsideVaultLabels[id], E_STREAMER_COLOR0xE74C3CFF);
    
ApplyAnimation(playerid"ROB_BANK""CAT_Safe_Rob"4.0100001);
    
RobberyType[playerid] = 2;
    
RobberyCounter[playerid] = 10;
    
RobberyTimer[playerid] = SetTimerEx("RobberyUpdate"1000true"i"playerid);
    return 
1;

All i need [CMD:emptydeposit+Coords Pickup And Checkpoints + Timer From This FS]
Reply
#2

Help Please! +Repp
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)