Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //============================================================================//
- // //
- // CREADO POR BADYX DESDE 0 //
- // //
- // FECHA DE INICIO DE SCRIPT 13 DE NOVIEMBRE DE 2011 //
- // //
- // PROHIBIDO ROBAR CREDITOS //
- // //
- //============================================================================//
- /* ======- NOTAS -====== */
- /* */
- /* GENERALMENTE SUELO USAR FUNCIONES CAMBIANDO EL NOMBRE PARA ASI
- FACILITARME EL TRABAJO. AQUI DEJO LAS FUNCIONES ORIGINALES
- */
- /*
- ProxDetector == MensajeUserCercano
- NombreEx == ObtenerNombre
- */
- /* INCLUDES */
- #include <a_samp>
- /* COLORES */
- #define COLOR_PURPLE 0xB60597FF
- #define AMARILLO 0xF5DEB3AA
- /* NEWS */
- new EstaDrogado[MAX_PLAYERS];
- new TieneMarihuana[MAX_PLAYERS];
- new TieneChocolate[MAX_PLAYERS];
- new TieneSpeed[MAX_PLAYERS];
- new TieneHeroina[MAX_PLAYERS];
- new BigEar[MAX_PLAYERS];
- #if defined FILTERSCRIPT
- #else
- main()
- {
- print("\n----------------------------------");
- print(" Sistema de drogas By The_Crazzy_Boy (Badyx) DESACTIVADO");
- print("----------------------------------\n");
- }
- #endif
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- new string[256];
- if (strcmp("/tipodedroga", cmdtext, true, 10) == 0)
- {
- SendClientMessage(playerid, AMARILLO, "Mariguana -- /UsarMarihuana");
- SendClientMessage(playerid, AMARILLO, "Chocolate -- /UsarChocolate");
- SendClientMessage(playerid, AMARILLO, "Speed -- /UsarSpeed");
- SendClientMessage(playerid, AMARILLO, "Heroina -- /UsarHeroina");
- return 1;
- }
- if (strcmp("/DameMarihuana", cmdtext, true, 10) == 0)
- {
- TieneMarihuana[playerid] = 1;
- return 1;
- }
- if (strcmp("/DameChocolate", cmdtext, true, 10) == 0)
- {
- TieneChocolate[playerid] = 1;
- return 1;
- }
- if (strcmp("/DameSpeed", cmdtext, true, 10) == 0)
- {
- TieneMarihuana[playerid] = 1;
- return 1;
- }
- if (strcmp("/Dameheroina", cmdtext, true, 10) == 0)
- {
- TieneHeroina[playerid] = 1;
- return 1;
- }
- if (strcmp("/UsarMariguana", cmdtext, true, 10) == 0)
- {
- if(EstaDrogado[playerid] == 1)
- {
- SendClientMessage(playerid, AMARILLO, "Aun estas drogado");
- return 1;
- }
- if(TieneMarihuana[playerid] == 0)
- {
- SendClientMessage(playerid, AMARILLO, "No tienes Marihuana");
- return 1;
- }
- SetTimerEx("Drogado", 30000, false, "i", playerid);
- EstaDrogado[playerid] = 1;
- format(string, sizeof(string), "* %s Saca un porro de marihuana y se lo fuma.", ObtenerNombre(playerid));
- MensajeUserCercano(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- return 1;
- }
- if (strcmp("/UsarChocolate", cmdtext, true, 10) == 0)
- {
- if(EstaDrogado[playerid] == 1)
- {
- SendClientMessage(playerid, AMARILLO, "Aun estas drogado");
- return 1;
- }
- if(TieneChocolate[playerid] == 0)
- {
- SendClientMessage(playerid, AMARILLO, "No tienes Chocolate");
- return 1;
- }
- SetTimerEx("Drogado", 30000, false, "i", playerid);
- EstaDrogado[playerid] = 1;
- format(string, sizeof(string), "* %s Saca un porro de Chocolate y se lo fuma.", ObtenerNombre(playerid));
- MensajeUserCercano(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- return 1;
- }
- if (strcmp("/UsarSpeed", cmdtext, true, 10) == 0)
- {
- if(EstaDrogado[playerid] == 1)
- {
- SendClientMessage(playerid, AMARILLO, "Aun estas drogado");
- return 1;
- }
- if(TieneSpeed[playerid] == 0)
- {
- SendClientMessage(playerid, AMARILLO, "No tienes Speed");
- return 1;
- }
- SetTimerEx("Drogado", 30000, false, "i", playerid);
- EstaDrogado[playerid] = 1;
- format(string, sizeof(string), "* %s Saca un polvo blanco y lo inhala.", ObtenerNombre(playerid));
- MensajeUserCercano(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- return 1;
- }
- if (strcmp("/UsarHeroina", cmdtext, true, 10) == 0)
- {
- if(EstaDrogado[playerid] == 1)
- {
- SendClientMessage(playerid, AMARILLO, "Aun estas drogado");
- return 1;
- }
- if(TieneHeroina[playerid] == 0)
- {
- SendClientMessage(playerid, AMARILLO, "No tienes Heroina");
- return 1;
- }
- SetTimerEx("Drogado", 30000, false, "i", playerid);
- EstaDrogado[playerid] = 1;
- format(string, sizeof(string), "* %s Saca una jeringuilla con un liquido y se lo inyecta en el brazo.", ObtenerNombre(playerid));
- MensajeUserCercano(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- return 1;
- }
- return 0;
- }
- forward Drogado(playerid);
- public Drogado(playerid)
- {
- new string[256];
- format(string, sizeof(string), "Se te paso el efecto de la droga.");
- GameTextForPlayer(playerid, string, 5000, 1);
- EstaDrogado[playerid] = 0;
- return 1;
- }
- forward MensajeUserCercano(Float:radi, playerid, string[],col1,col2,col3,col4,col5);
- public MensajeUserCercano(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);
- //radi = 2.0; //Trigger Radius
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i) && (GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(i)))
- {
- if(!BigEar[i])
- {
- GetPlayerPos(i, posx, posy, posz);
- tempposx = (oldposx -posx);
- tempposy = (oldposy -posy);
- tempposz = (oldposz -posz);
- //printf("DEBUG: X:%f Y:%f Z:%f",posx,posy,posz);
- if (((tempposx < radi/16) && (tempposx > -radi/16)) && ((tempposy < radi/16) && (tempposy > -radi/16)) && ((tempposz < radi/16) && (tempposz > -radi/16)))
- {
- SendClientMessage(i, col1, string);
- }
- else if (((tempposx < radi/8) && (tempposx > -radi/8)) && ((tempposy < radi/8) && (tempposy > -radi/8)) && ((tempposz < radi/8) && (tempposz > -radi/8)))
- {
- SendClientMessage(i, col2, string);
- }
- else if (((tempposx < radi/4) && (tempposx > -radi/4)) && ((tempposy < radi/4) && (tempposy > -radi/4)) && ((tempposz < radi/4) && (tempposz > -radi/4)))
- {
- SendClientMessage(i, col3, string);
- }
- else if (((tempposx < radi/2) && (tempposx > -radi/2)) && ((tempposy < radi/2) && (tempposy > -radi/2)) && ((tempposz < radi/2) && (tempposz > -radi/2)))
- {
- SendClientMessage(i, col4, string);
- }
- else if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
- {
- SendClientMessage(i, col5, string);
- }
- }
- else
- {
- SendClientMessage(i, col1, string);
- }
- }
- }
- }
- return 1;
- }
- stock ObtenerNombre(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;
- }
- //============================================================================//
- // SI TE SIRVIO RESPETA EL TRABAJO DEL CREADOR //
- // //
- //=========================FINAL DEL FILESCRIPT===============================//
Advertisement
Add Comment
Please, Sign In to add comment