Search

open.mp forum

RegisterLogin

Discussion

General
Chat
Tech
Life
Art
Programming
open.mp
Development Updates
Questions and Suggestions
SA-MP
General Discussions
Videos and Screenshots
Support
Pawn Scripting
Tutorials
Releases
Plugins
Libraries
Filterscripts
Gamemodes
Maps
Advertisements
Other languages
Spanish/Espa?ol
Programaci?n
Discusi?n GTA SA Multijugador
Mods
Offtopic
Juegos
Portuguese/Portugu?s
Russian/???????
Italian/Italiano
Dutch/Nederlands
German/Deutsch
Romanian/Rom?na
Ex-Yu
Polish/Polski
Og?lne
Serwery
Skryptowanie
Filmiki i zdjecia
Lithuanian/Lietuvi?kas
French/Fran?ais
Hungarian/Magyar
Hindi/Urdu
Turkish
Other
Internal
Team
Hidden
Archived

Library

 Collections Links Members Roles

Bank Robbery System [HELP!]

// Bank Robbery new robbing; new alreadyrobbed; new robbingTimer; forward bankrob(playerid); forward robbedoff(playerid); public...

ID
d6ouivfilegovhg7bd6g
author
fuzzy's avatar

Fuzzy

@fuzzy


View profile
Copy link
  Report member
started
Sep 24, 2019
replies
0
participating
No

scroll to top

powered by storyden

Login
Discussion
Pawn Scripting
Bank Robbery System [HELP!]
fuzzy's avatar

Fuzzy

@fuzzy


View profile
Copy link
  Report member
• 6y
Pawn Scripting

Bank Robbery System [HELP!]

pawn
// Bank Robbery

new robbing;

new alreadyrobbed;

new robbingTimer;

forward bankrob(playerid);

forward robbedoff(playerid);



public bankrob(playerid)

{

? ?new robcash = random(25000)  35000;

? ?SendClientMessage(playerid, COLOR_WHITE, " Your finished robbing the bank, Run now");

? ?GiveMoney(playerid, robcash);

? ?//SendClientMessage(playerid, COLOR_WHITE, "You've been rob {33CC33}%s{FFFFFF}Dollars from the bank vault.", FormatNumber(robcash));

? ?alreadyrobbed = 1;

? ?robbing = 0;

? ?robbingTimer = SetTimerEx("robbedoff", 3600000, false, "i", playerid);

? ?SendClientMessageToAll(COLOR_ORANGE, "||----------Latest News----------||");

? ?SendClientMessageToAll(COLOR_WHITE, " It looks like the bankrobber got the cash.");

? ?SendClientMessageToAll(COLOR_WHITE, " The cops is currently waiting outside.");

? ?SendClientMessageToAll(COLOR_ORANGE, "||----------Latest News----------||");

? ?return 1;

}

public robbedoff(playerid)

{

? ?alreadyrobbed = 0;

? ?SendClientMessage(playerid, COLOR_WHITE, " You can now rob the bank again [/report to ask an admin to approve.]");

? ?return 1;

}





public OnPlayerDeath(playerid, killerid, reason)

{

? ?// Bank Robbey

? ?KillTimer(robbingTimer);

? ?robbing = 0;

? ?SendClientMessageToAll(COLOR_ORANGE, "||----------Latest News----------||");

? ?SendClientMessageToAll(COLOR_WHITE, " Los Santos Police have been caught the suspect. ");

? ?SendClientMessageToAll(COLOR_ORANGE, "||----------Latest News----------||");

return 1;

}





public OnPlayerDisconnect(playerid, reason)

{

? ?/*// Bank Robbey

? ?KillTimer(robbingTimer);

? ?robbing = 0;

? ?SendClientMessageToAll(COLOR_ORANGE, "||----------Latest News----------||");

? ?SendClientMessageToAll(COLOR_WHITE, " Los Santos Police have been caught the suspect. ");

? ?SendClientMessageToAll(COLOR_ORANGE, "||----------Latest News----------||");*/





CMD:robbank(playerid, params[])

{

if(robbing == 1)

? ? ? return SendErrorMessage(playerid, " You are already robbing the bank, please slow down");



? ?if(alreadyrobbed == 1)

? ? ? return SendErrorMessage(playerid, "You already robbed the bank! Wait 1 hour.");

? ? ? ? ? ? ? 

? if (!Inventory_HasItem(playerid, "C4"))

? ? ? return SendErrorMessage(playerid, "You don't have a C4.");

? ? ? ? ? ?

? ?if(!IsPlayerInRangeOfPoint(playerid, 5.0, 1435.3354,-981.6418,983.6462)) return SendErrorMessage(playerid, "You are not at the bank !");



? ?SendClientMessage(playerid, COLOR_WHITE, " You started to rob the bank, This will take 10 minutes");

? ?SetTimerEx("bankrob", 600000, false, "i", playerid);

? ?robbing = 1;

? ?Inventory_Remove(playerid, "C4");

? ?SendClientMessageToAll(COLOR_ORANGE, "||----------Latest News----------||");

? ?SendClientMessageToAll(COLOR_WHITE, " The bank is currently getting robbed.");

? ?SendClientMessageToAll(COLOR_WHITE, " Los Santos Police units are on the way.");

? ?SendClientMessageToAll(COLOR_WHITE, " We will report more when we get more information");

? ?SendClientMessageToAll(COLOR_ORANGE, "||----------Latest News----------||");

? ?return 1;

}





when player die/quit its gives the msg of the suspect is down but if he stays online for 10min he still get the cash and also if he's relog after quiting he still get the cash after 10 minutes.

Also sometimes the?" Los Santos Police have been caught the suspect. " message showing for no reason

Have any idea how to fix it?

0 likes0 replies

    Please sign up or log in to reply