Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- - Simple Sistema de Orina - Script Base
- - Autor: OTACON
- - Para: sa-mp.com
- */
- #include <a_samp>
- #include <zcmd>
- #include <sscanf2>
- #include <Progress>
- #define COLOR_BARRA 0xFFFF55C1
- #define COLOR_PURPLE 0xC2A2DAAA
- #define COLOR_GRAD2 0xBFC0C2FF
- #define SPECIAL_ACTION_PISSING (68)
- #define TIEMPO_PARA_ORINA (5000)
- #define TIEMPO_EN_ORINA (500)
- new
- Bar:BarraOrina[MAX_PLAYERS],
- LlenarOrina[MAX_PLAYERS],
- MatarOrina[MAX_PLAYERS][3],
- EstasOrinando[MAX_PLAYERS];
- public OnFilterScriptInit()
- {
- for(new playerid;playerid<MAX_PLAYERS;playerid++) LlenarOrina[playerid] = 0;
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- EstasOrinando[playerid] = 0;
- BarraOrina[playerid] = CreateProgressBar(549.00, 26.00, 57.50, 6.19, COLOR_BARRA, 100.0);
- SetProgressBarValue(BarraOrina[playerid], LlenarOrina[playerid]);
- MatarOrina[playerid][1] = SetTimerEx("ActualizarBarraOrina", TIEMPO_PARA_ORINA, true, "i", playerid);
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- HideProgressBarForPlayer(playerid, BarraOrina[playerid]);
- DestroyProgressBar(BarraOrina[playerid]);
- KillTimer(MatarOrina[playerid][1]);
- KillTimer(MatarOrina[playerid][2]);
- EstasOrinando[playerid] = 0;
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- ShowProgressBarForPlayer(playerid, BarraOrina[playerid]);
- return 1;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- if(EstasOrinando[playerid] == 1)
- {
- SetPlayerSpecialAction(playerid,SPECIAL_ACTION_NONE);
- EstasOrinando[playerid] = 0;
- KillTimer(MatarOrina[playerid][2]);
- return 1;
- }
- return 1;
- }
- COMMAND:orinar(playerid, params[])
- {
- new string[128], name[MAX_PLAYER_NAME+1];
- GetPlayerName(playerid, name, sizeof(name));
- if(LlenarOrina[playerid] <= 50) return SendClientMessage(playerid, COLOR_GRAD2, "Usted no tiene ganas de orinar.");
- if(EstasOrinando[playerid] == 1) return SendClientMessage(playerid, COLOR_GRAD2, "Usted ya está orinando.");
- format(string, sizeof(string), "%s se baja el cierre de su pantalón y comienza a orinar.", name);
- ProxDetector(20.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- MatarOrina[playerid][2] = SetTimerEx("BajandorBarraOrina", TIEMPO_EN_ORINA, true, "i", playerid);
- EstasOrinando[playerid] = 1;
- return 1;
- }
- forward BajandorBarraOrina(playerid);
- public BajandorBarraOrina(playerid)
- {
- new s[128], name[MAX_PLAYER_NAME+1];
- GetPlayerName(playerid, name, sizeof(name));
- LlenarOrina[playerid] --;
- SetProgressBarValue(BarraOrina[playerid], LlenarOrina[playerid]);
- UpdateProgressBar(BarraOrina[playerid], playerid);
- SetPlayerSpecialAction(playerid,SPECIAL_ACTION_PISSING);
- switch(LlenarOrina[playerid])
- {
- case 5:
- {
- SetPlayerSpecialAction(playerid,SPECIAL_ACTION_NONE);
- LlenarOrina[playerid] = 0;
- EstasOrinando[playerid] = 0;
- KillTimer(MatarOrina[playerid][2]);
- format(s, sizeof(s), "%s para de orinar y se sube el cierre de su pantalón.", name);
- ProxDetector(20.0, playerid, s, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- }
- }
- return 1;
- }
- forward ActualizarBarraOrina(playerid);
- public ActualizarBarraOrina(playerid)
- {
- new s[128], name[MAX_PLAYER_NAME+1];
- GetPlayerName(playerid, name, sizeof(name));
- LlenarOrina[playerid] ++;
- SetProgressBarValue(BarraOrina[playerid], LlenarOrina[playerid]);
- UpdateProgressBar(BarraOrina[playerid], playerid);
- switch(LlenarOrina[playerid])
- {
- case 50: {
- format(s, sizeof(s), "Atención %s: Usted tiene un nivel de orina de 50%%, vaya a orinar o se orinará involuntariamente.", name);
- SendClientMessage(playerid, -1, s);
- SendClientMessage(playerid, COLOR_GRAD2, "Utilice: /orinar");
- }
- case 60: {
- format(s, sizeof(s), "Atención %s: Usted tiene un nivel de orina de 60%%, vaya a orinar o se orinará involuntariamente.", name);
- SendClientMessage(playerid, -1, s);
- SendClientMessage(playerid, COLOR_GRAD2, "Utilice: /orinar");
- }
- case 80: {
- format(s, sizeof(s), "Atención %s: Usted tiene un nivel de orina de 80%%, vaya a orinar o se orinará involuntariamente.", name);
- SendClientMessage(playerid, -1, s);
- SendClientMessage(playerid, COLOR_GRAD2, "Utilice: /orinar");
- }
- case 100: {
- LlenarOrina[playerid] = 0;
- format(s, sizeof(s), "%s se orina involuntariamente, debido a que no aguantó.", name);
- ProxDetector(20.0, playerid, s, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- SendClientMessage(playerid, -1, "¡Oh! {FF0000}se ha orinado encima. {FFFFFF}Que desilusión, la próxima vez evite ésto.");
- }
- }
- return 1;
- }
- forward ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5);
- public 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) && (GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(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 the player is within 16 meters
- {
- SendClientMessage(i, col1, string);
- }
- else if (((tempposx < radi/8) && (tempposx > -radi/8)) && ((tempposy < radi/8) && (tempposy > -radi/8)) && ((tempposz < radi/8) && (tempposz > -radi/8))) // within 8 meters
- {
- SendClientMessage(i, col2, string);
- }
- else if (((tempposx < radi/4) && (tempposx > -radi/4)) && ((tempposy < radi/4) && (tempposy > -radi/4)) && ((tempposz < radi/4) && (tempposz > -radi/4))) //4 meters
- {
- SendClientMessage(i, col3, string);
- }
- else if (((tempposx < radi/2) && (tempposx > -radi/2)) && ((tempposy < radi/2) && (tempposy > -radi/2)) && ((tempposz < radi/2) && (tempposz > -radi/2))) //2 meters
- {
- SendClientMessage(i, col4, string);
- }
- else if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi))) //1 meter
- {
- SendClientMessage(i, col5, string);
- }
- }
- else
- {
- SendClientMessage(i, col1, string);
- }
- }
- }
- return 1;
- }
- COMMAND:test1(playerid, params[])
- {
- LlenarOrina[playerid] = 0;
- LlenarOrina[playerid] = 49;
- return 1;
- }
- COMMAND:test2(playerid, params[])
- {
- LlenarOrina[playerid] = 0;
- LlenarOrina[playerid] = 59;
- return 1;
- }
- COMMAND:test3(playerid, params[])
- {
- LlenarOrina[playerid] = 0;
- LlenarOrina[playerid] = 79;
- return 1;
- }
- COMMAND:test4(playerid, params[])
- {
- LlenarOrina[playerid] = 0;
- LlenarOrina[playerid] = 99;
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement