robbery
#1

i want to increase roobery loot about 20k or 30k
public countRobTime()
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(playerData[i][playerLoggedIn])
{
if(playerData[i][playerRobTime] > 0)
{
if(playerData[i][playerStoreID] > 0)
{
if(IsPlayerInDynamicCP(i, playerData[i][playerCheckID]))
{
new pl = playerData[i][robberyFriend];
playerData[i][playerRobTime]--;
updatePlayerRobbingProgress(i, playerData[i][playerRobTime]);
if(IsPlayerConnected(pl))
{
if(playerData[pl][playerLoggedIn])
{
if(GetPlayerTargetActor(pl) != playerData[pl][targetActor])
{
updatePlayerRobbingProgress(pl, 0);
TextDrawHideForPlayer(pl, newRob);
HideProgressBarForPlayer(pl, playerData[pl][robbery]);
ClearActorAnimations(playerData[pl][targetActor]);
SendClientMessage(i, -1, "{B7B7B7}[SERVER] {FFFFFF}Robbery failed, your team is no longer aiming store actor.");
playerData[i][robberyFriend] = INVALID_PLAYER_ID;
forceRobberyCancel(i);
}
}
}

if(playerData[i][playerRobTime] == 0)
{
new moneyToGive, message2[328], playerName[24], currentStoreID, robberyBonus;
new randomNum = random(4);
if (randomNum != 0 || playerData[i][luckyCharm] || playerData[i][playerRobberies] < 5)
{
currentStoreID = playerData[i][playerStoreID] - 1;

if (playerData[i][playerBiggerPockets])
{
// $500 bonus
moneyToGive = randomEx(checkpointData[currentStoreID][lowestCash], checkpointData[currentStoreID][highestCash]);
robberyBonus = (moneyToGive / 2);
}
else
{
// No bonuses
moneyToGive = randomEx(checkpointData[currentStoreID][lowestCash], checkpointData[currentStoreID][highestCash]);
}

checkpointData[currentStoreID][lastRobbed] = GetTickCount();
checkpointData[currentStoreID][storeStatus] = 1;

playerData[i][playerRobTime] = -1;
playerData[i][playerRobberies]++;
playerGiveMoney(i, moneyToGive);
playerGiveMoney(i, robberyBonus);
GetPlayerName(i, playerName, sizeof(playerName));
ClearAnimations(i);
RemovePlayerAttachedObject(i, 0);
DestroyDynamicObject(playerData[i][playerSafeObj]);

if(IsPlayerConnected(pl))
{
if(playerData[pl][playerLoggedIn])
{
playerGiveMoney(pl, moneyToGive);
playerGiveMoney(pl, robberyBonus);
ClearActorAnimations(playerData[pl][targetActor]);
}
}

if (playerData[i][playerBiggerPockets])
{
// Has a bonus
format(message2, sizeof(message2), "{FF0000}[ROBBERY] {FFFFFF}%s(%i) robbed %s and received {FFDC2E}$%s {FFFFFF}({58D3F7}+$%s{FFFFFF})", playerName, i, checkpointData[currentStoreID][storeName], FormatNumber(moneyToGive), FormatNumber(robberyBonus));
if(IsPlayerConnected(pl))
{
if(playerData[pl][playerLoggedIn])
{
new plname[MAX_PLAYER_NAME];
GetPlayerName(pl, plname, MAX_PLAYER_NAME);
format(message2, sizeof(message2), "{FF0000}[ROBBERY] {FFFFFF}%s(%i) and %s(%i) robbed %s and received {FFDC2E}$%s {FFFFFF}({58D3F7}+$%s{FFFFFF})", playerName, i, plname, pl, checkpointData[currentStoreID][storeName], FormatNumber(moneyToGive * 2), FormatNumber(robberyBonus * 2));
}
}
}
else
{
// No bonus
format(message2, sizeof(message2), "{FF0000}[ROBBERY] {FFFFFF}%s(%i) robbed %s and received {FFDC2E}$%s {FFFFFF}", playerName, i, checkpointData[currentStoreID][storeName], FormatNumber(moneyToGive));
if(IsPlayerConnected(pl))
{
if(playerData[pl][playerLoggedIn])
{
new plname[MAX_PLAYER_NAME];
GetPlayerName(pl, plname, MAX_PLAYER_NAME);
format(message2, sizeof(message2), "{FF0000}[ROBBERY] {FFFFFF}%s(%i) and %s(%i) robbed %s and received {FFDC2E}$%s", playerName, i, plname, pl, checkpointData[currentStoreID][storeName], FormatNumber(moneyToGive * 2));
}
}
}

if (playerData[i][mask])
{
SendClientMessage(i, COLOR_WHITE, message2);
if(IsPlayerConnected(pl))
{
if(playerData[pl][playerLoggedIn])
{
SendClientMessage(pl, COLOR_WHITE, message2);
}
}
}
else
{
SendClientMessageToAll(COLOR_WHITE, message2);
}

givePlayerWanted(i, 6);
playerGiveXP(i, 20);
sendWantedMessage(i, 6);
playerData[i][playerScore] = playerData[i][playerScore] + 1;
SetPlayerScore(i, playerData[i][playerScore]);
TextDrawHideForPlayer(i, newRob);
newPlayerColour(i);

if(IsPlayerConnected(pl))
{
if(playerData[pl][playerLoggedIn])
{
givePlayerWanted(pl, 6);
playerGiveXP(pl, 20);
sendWantedMessage(pl, 6);
playerData[pl][playerScore] = playerData[pl][playerScore] + 1;
SetPlayerScore(pl, playerData[pl][playerScore]);
TextDrawHideForPlayer(pl, newRob);
newPlayerColour(pl);
}
}
if (playerData[i][playerRobberies] == 1)
{
disableAchieve(i);
PlayerTextDrawShow(i, playerData[i][Achieve1]);
PlayerTextDrawShow(i, playerData[i][Achieve2]);
PlayerTextDrawShow(i, playerData[i][Achieve3]);
PlayerTextDrawShow(i, playerData[i][Achieve4]);

PlayerTextDrawSetString(i, playerData[i][Achieve3], "Cat Burgler");
PlayerTextDrawSetString(i, playerData[i][Achieve4], "You robbed your first store!");
PlayerPlaySound(i, 1185 ,0.0, 0.0, 0.0);

playerData[i][achieveTimer] = SetTimerEx("disableAchieve", 6000, false, "i", i);

playerGiveXP(i, 50);
playerData[i][playerScore] = playerData[i][playerScore] + 2;
SetPlayerScore(i, playerData[i][playerScore]);
savePlayerStats(i);
}
else if (playerData[i][playerRobberies] == 50)
{
disableAchieve(i);
PlayerTextDrawShow(i, playerData[i][Achieve1]);
PlayerTextDrawShow(i, playerData[i][Achieve2]);
PlayerTextDrawShow(i, playerData[i][Achieve3]);
PlayerTextDrawShow(i, playerData[i][Achieve4]);

PlayerTextDrawSetString(i, playerData[i][Achieve3], "Established Thief");
PlayerTextDrawSetString(i, playerData[i][Achieve4], "You robbed 50 stores!");
PlayerPlaySound(i, 1183 ,0.0, 0.0, 0.0);

playerData[i][achieveTimer] = SetTimerEx("disableAchieve", 6000, false, "i", i);

playerGiveXP(i, 50);
playerData[i][playerScore] = playerData[i][playerScore] + 2;
SetPlayerScore(i, playerData[i][playerScore]);
savePlayerStats(i);
}
else if (playerData[i][playerRobberies] == 100)
{
disableAchieve(i);
PlayerTextDrawShow(i, playerData[i][Achieve1]);
PlayerTextDrawShow(i, playerData[i][Achieve2]);
PlayerTextDrawShow(i, playerData[i][Achieve3]);
PlayerTextDrawShow(i, playerData[i][Achieve4]);

PlayerTextDrawSetString(i, playerData[i][Achieve3], "Master Thief");
PlayerTextDrawSetString(i, playerData[i][Achieve4], "You robbed 100 stores!");
PlayerPlaySound(i, 1183 ,0.0, 0.0, 0.0);

playerData[i][achieveTimer] = SetTimerEx("disableAchieve", 6000, false, "i", i);

playerGiveXP(i, 50);
playerData[i][playerScore] = playerData[i][playerScore] + 2;
SetPlayerScore(i, playerData[i][playerScore]);
savePlayerStats(i);
}
else if (playerData[i][playerRobberies] == 200)
{
disableAchieve(i);
PlayerTextDrawShow(i, playerData[i][Achieve1]);
PlayerTextDrawShow(i, playerData[i][Achieve2]);
PlayerTextDrawShow(i, playerData[i][Achieve3]);
PlayerTextDrawShow(i, playerData[i][Achieve4]);

PlayerTextDrawSetString(i, playerData[i][Achieve3], "The Heist");
PlayerTextDrawSetString(i, playerData[i][Achieve4], "Lucky Charm unlocked!");
PlayerPlaySound(i, 1183 ,0.0, 0.0, 0.0);

playerData[i][achieveTimer] = SetTimerEx("disableAchieve", 6000, false, "i", i);

playerGiveXP(i, 50);
playerData[i][playerScore] = playerData[i][playerScore] + 2;
SetPlayerScore(i, playerData[i][playerScore]);
savePlayerStats(i);
}
playerData[i][robberyFriend] = INVALID_PLAYER_ID;
}
else
{
currentStoreID = playerData[i][playerStoreID] - 1;
moneyToGive = randomEx(checkpointData[currentStoreID][lowestCash], checkpointData[currentStoreID][highestCash]);

checkpointData[currentStoreID][lastRobbed] = GetTickCount();
checkpointData[currentStoreID][storeStatus] = 1;

playerData[i][playerRobTime] = -1;
playerData[i][playerRobberies]++;
GetPlayerName(i, playerName, sizeof(playerName));
ClearAnimations(i);
RemovePlayerAttachedObject(i, 0);
DestroyDynamicObject(playerData[i][playerSafeObj]);

format(message2, sizeof(message2), "{FF0000}[ROBBERY] {FFFFFF}%s(%i) attempted to rob %s and failed", playerName, i, checkpointData[currentStoreID][storeName]);
if(IsPlayerConnected(pl))
{
if(playerData[pl][playerLoggedIn])
{
new plname[MAX_PLAYER_NAME];
GetPlayerName(pl, plname, MAX_PLAYER_NAME);
format(message2, sizeof(message2), "{FF0000}[ROBBERY] {FFFFFF}%s(%i) and %s(%i) attempted to rob %s and failed", playerName, i, plname, pl, checkpointData[currentStoreID][storeName]);
givePlayerWanted(pl, 6);
sendWantedMessage(pl, 6);
TextDrawHideForPlayer(pl, newRob);
newPlayerColour(pl);
}
}

SendClientMessageToAll(COLOR_WHITE, message2);

// Add to player's wanted level
givePlayerWanted(i, 6);
sendWantedMessage(i, 6);
TextDrawHideForPlayer(i, newRob);
newPlayerColour(i);
playerData[i][robberyFriend] = INVALID_PLAYER_ID;
}
}
}
else
{
forceRobberyCancel(i);
}
}
Reply


Messages In This Thread
robbery - by KNIGHT786 - 21.12.2016, 07:39
Re: robbery - by X337 - 21.12.2016, 08:35
Re: robbery - by KNIGHT786 - 21.12.2016, 08:39
Re: robbery - by X337 - 21.12.2016, 08:45
Re: robbery - by KNIGHT786 - 21.12.2016, 08:51
Re: robbery - by KNIGHT786 - 28.12.2016, 19:05
Re: robbery - by iLearner - 28.12.2016, 22:14

Forum Jump:


Users browsing this thread: 2 Guest(s)