Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Sistema atraco al banco By Badyx
- */
- #include <a_samp>
- /* Macros */
- #define \
- funcion%0(%1) \
- forward %0(%1); public %0(%1)
- /* Colores */
- #define Rojo 0xAA3333AA
- #define Verde 0x9EC73DAA
- #define Rosado 0xC2A2DAAA
- /* News */
- new AtracarBanco = 0;
- new IntentosAtraco = 0;
- new bool:EstaAtracando[MAX_PLAYERS];
- new BigEar[MAX_PLAYERS];
- #if defined FILTERSCRIPT
- public OnFilterScriptInit() /* Badyx */
- {
- AtracarBanco = 0;
- IntentosAtraco = 0;
- return 1;
- }
- #else
- main(){}
- #endif
- funcion OnPlayerConnect(playerid) /* Badyx */
- {
- Seteos(playerid);
- return 1;
- }
- funcion OnPlayerDisconnect(playerid, reason) /* Badyx */
- {
- Seteos(playerid);
- return 1;
- }
- funcion OnPlayerCommandText(playerid, cmdtext[])
- {
- new string[150];
- if (strcmp("/AtracarBanco", cmdtext, true, 10) == 0) /* Badyx */
- {
- if(AtracarBanco == 1)return SendClientMessage(playerid, Rojo, #[Error] Este banco no posee mas dinero);
- if(EstaAtracando[playerid] == true) return SendClientMessage(playerid, Rojo, #[Error] Usted ya esta atracando);
- if(IntentosAtraco == 3) AtracarBanco = 1;
- if (!PlayerToPoint(100, playerid,-30.875, -88.9609, 1004.53)) return SendClientMessage(playerid, Rojo, #[Error] Usted no esta en el banco);
- if(GetPlayerWeapon(playerid) >= 1)
- {
- new gunID = GetPlayerWeapon(playerid), gunname[32];
- GetWeaponName(gunID, gunname, sizeof(gunname));
- format(string, sizeof(string), " %s empuña su %s y apunta al cajero.", NombreEx(playerid),gunname);
- ProxDetector(12.0, playerid, string,Rosado,Rosado,Rosado,Rosado,Rosado);
- EstaAtracando[playerid] = true;
- SetTimerEx("Atracando", 10000, false, "i", playerid);
- return 1;
- }
- return SendClientMessage(playerid, Rojo, #[Error] Necesitas un arma);
- }
- return 0;
- }
- funcion TerminarAtraco(playerid) /* Badyx */
- {
- EstaAtracando[playerid] = false;
- return 1;
- }
- funcion Atracando(playerid) /* Badyx */
- {
- new Opciones = random(4);
- EstaAtracando[playerid] = false;
- switch(Opciones)
- {
- case 0,3,2: { SendClientMessage(playerid, Rojo, #[Info] Tu arma a caido al suelo y no pudiste atracar. PATOSO); IntentosAtraco +=1; return 1; }
- case 1,4: DineroAtraco(playerid);
- }
- return 1;
- }
- funcion VolveraAtracar(playerid) /* Badyx */
- {
- Seteos(playerid);
- return 1;
- }
- funcion DineroAtraco(playerid) /* Badyx */
- {
- new Dinero = random(15000); Dinero += 10000;
- new string[128];
- format(string, sizeof(string), "Conseguiste %d en el atraco", Dinero);
- SendClientMessage(playerid,Verde, string);
- AtracarBanco = 1;
- GivePlayerMoney(playerid, Dinero);
- SetTimer("VolveraAtracar", 600000, 1); /* 10 Minutos */
- return 1;
- }
- funcion Seteos(playerid) /* Badyx */
- {
- EstaAtracando[playerid] = false;
- EstaAtracando[playerid] = false;
- return 1;
- }
- /* Funciones de otros */
- stock NombreEx(playerid) /* ¿? */
- {
- new string[24];
- GetPlayerName(playerid,string,24);
- new str[24];
- strmid(str,string,0,strlen(string),24);
- for(new i = 0; i < MAX_PLAYER_NAME; i++)
- {
- if (str[i] == '_') str[i] = ' ';
- }
- return str;
- }
- funcion ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5) /* ¿? */
- {
- if(IsPlayerConnected(playerid))
- {
- new Float:posx, Float:posy, Float:posz;
- new Float:oldposx, Float:oldposy, Float:oldposz;
- new Float:tempposx, Float:tempposy, Float:tempposz;
- GetPlayerPos(playerid, oldposx, oldposy, oldposz);
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i))
- {
- if(!BigEar[i])
- {
- GetPlayerPos(i, posx, posy, posz);
- tempposx = (oldposx -posx);
- tempposy = (oldposy -posy);
- tempposz = (oldposz -posz);
- if (((tempposx < radi/16) && (tempposx > -radi/16)) && ((tempposy < radi/16) && (tempposy > -radi/16)) && ((tempposz < radi/16) && (tempposz > -radi/16)))
- {
- if(GetPlayerVirtualWorld(i) == GetPlayerVirtualWorld(playerid))
- {
- SendClientMessage(i, col1, string);
- }
- }
- else if (((tempposx < radi/8) && (tempposx > -radi/8)) && ((tempposy < radi/8) && (tempposy > -radi/8)) && ((tempposz < radi/8) && (tempposz > -radi/8)))
- {
- if(GetPlayerVirtualWorld(i) == GetPlayerVirtualWorld(playerid))
- {
- SendClientMessage(i, col2, string);
- }
- }
- else if (((tempposx < radi/4) && (tempposx > -radi/4)) && ((tempposy < radi/4) && (tempposy > -radi/4)) && ((tempposz < radi/4) && (tempposz > -radi/4)))
- {
- if(GetPlayerVirtualWorld(i) == GetPlayerVirtualWorld(playerid))
- {
- SendClientMessage(i, col3, string);
- }
- }
- else if (((tempposx < radi/2) && (tempposx > -radi/2)) && ((tempposy < radi/2) && (tempposy > -radi/2)) && ((tempposz < radi/2) && (tempposz > -radi/2)))
- {
- if(GetPlayerVirtualWorld(i) == GetPlayerVirtualWorld(playerid))
- {
- SendClientMessage(i, col4, string);
- }
- }
- else if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
- {
- if(GetPlayerVirtualWorld(i) == GetPlayerVirtualWorld(playerid))
- {
- SendClientMessage(i, col5, string);
- }
- }
- }
- else
- {
- SendClientMessage(i, col1, string);
- }
- }
- }
- }
- return 1;
- }
- funcion 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;
- }
- //============================================================================//
- // //
- // FINAL DEL SCRIPT //
- // //
- // SI TE SIRVIO, RESPETA EL TRABAJO DEL CREADOR //
- // //
- //============================================================================//
Advertisement
Add Comment
Please, Sign In to add comment