Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #define dcmd(%1,%2,%3) if (!strcmp((%3)[1], #%1, true, (%2)) && ((((%3)[(%2) + 1] == '\0') && (dcmd_%1(playerid, ""))) || (((%3)[(%2) + 1] == ' ') && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
- new robcasino,casino[MAX_PLAYERS];
- forward RobAgain2();
- forward PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z);
- #define COLOR_DODGERBLUE 0x1E90FFAA
- #define COLOR_ERROR 0xD2691EAA
- #define COLOR_SYSTEM 0x9ACD32AA
- main()
- {
- print("\n----------------------------------");
- print(" Blank Gamemode by your name here");
- print("----------------------------------\n");
- }
- public OnGameModeInit()
- {
- SetTimer("casinorob",1000,true);
- SetTimer("RobAgain2",1800000,1);
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- dcmd(robcasino,9,cmdtext);
- return 0;
- }
- dcmd_robcasino(playerid, params[])
- {
- if(PlayerToPoint(3, playerid, 1141.822509,9.046521,1000.671875))
- {
- SetTimer("robtimer",40000,false);
- new id = strval(params);
- new name[24],pname[24],string[256],reason[24];
- GetPlayerName( playerid, name, 24 );
- GetPlayerName( id, pname, 24 );
- format(string,sizeof(string),"%s Has begin to rob the casino",name,pname,reason);
- SendClientMessageToAll(COLOR_SYSTEM,string);
- casino[playerid] = 30;
- SetTimer("finishrob",1000,true);
- }
- return 1;
- }
- public PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z)
- {
- if(IsPlayerConnected(playerid))
- {
- new Float:oldposx, Float:oldposy, Float:oldposz;
- new Float:tempposx, Float:tempposy, Float:tempposz;
- GetPlayerPos(playerid, oldposx, oldposy, oldposz);
- tempposx = (oldposx -x);
- tempposy = (oldposy -y);
- tempposz = (oldposz -z);
- if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
- {
- return 1;
- }
- }
- return 0;
- }
- public OnPlayerPickUpPickup(playerid, pickupid)
- {
- if(pickupid == robcasino)
- {
- GameTextForPlayer(playerid,"~w~Type /robcasino.",5000,5);
- }
- return 1;
- }
- forward casinorob();
- public casinorob()
- {
- for(new i = 0; i <= MAX_PLAYERS; i++)
- {
- if(casino[i] >= 1)
- {
- new RobText[115];
- if(casino[i] >= 2) {
- format(RobText, sizeof(RobText), "Robbery Complete in %d",casino[i]);
- GameTextForPlayer(i, RobText, 2000,3);
- casino[i] --;
- }
- }
- }
- }
- forward finishrob();
- public finishrob()
- {
- for(new i = 0; i <= MAX_PLAYERS; i++)
- {
- if(casino[i] == 1)
- {
- new string[256],string1[256],name[16];
- GetPlayerName(i, name, 24 );
- new money = random(500000);
- GivePlayerMoney(i,money);
- casino[i] = 0;
- format(string,256,"You robbed a total of $%i from the Casino!",money);
- format(string1,256," %s(%d) robbed a total of $%i from the Casino!",name,i,money);
- SendClientMessage(i,COLOR_SYSTEM,string);
- SendClientMessageToAll(COLOR_SYSTEM,string1);
- return true;
- }
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement