Advertisement
Guest User

Simple Sistema de Orina - Script Base - By Otacon

a guest
Dec 15th, 2012
352
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.72 KB | None | 0 0
  1.  
  2. /*
  3. - Simple Sistema de Orina - Script Base
  4. - Autor: OTACON
  5. - Para: sa-mp.com
  6. */
  7.  
  8. #include <a_samp>
  9. #include <zcmd>
  10. #include <sscanf2>
  11. #include <Progress>
  12.  
  13. #define COLOR_BARRA 0xFFFF55C1
  14. #define COLOR_PURPLE 0xC2A2DAAA
  15. #define COLOR_GRAD2 0xBFC0C2FF
  16.  
  17. #define SPECIAL_ACTION_PISSING (68)
  18. #define TIEMPO_PARA_ORINA (5000)
  19. #define TIEMPO_EN_ORINA (500)
  20.  
  21. new
  22. Bar:BarraOrina[MAX_PLAYERS],
  23. LlenarOrina[MAX_PLAYERS],
  24. MatarOrina[MAX_PLAYERS][3],
  25. EstasOrinando[MAX_PLAYERS];
  26.  
  27. public OnFilterScriptInit()
  28. {
  29. for(new playerid;playerid<MAX_PLAYERS;playerid++) LlenarOrina[playerid] = 0;
  30. return 1;
  31. }
  32.  
  33. public OnPlayerConnect(playerid)
  34. {
  35. EstasOrinando[playerid] = 0;
  36. BarraOrina[playerid] = CreateProgressBar(549.00, 26.00, 57.50, 6.19, COLOR_BARRA, 100.0);
  37. SetProgressBarValue(BarraOrina[playerid], LlenarOrina[playerid]);
  38. MatarOrina[playerid][1] = SetTimerEx("ActualizarBarraOrina", TIEMPO_PARA_ORINA, true, "i", playerid);
  39. return 1;
  40. }
  41.  
  42. public OnPlayerDisconnect(playerid, reason)
  43. {
  44. HideProgressBarForPlayer(playerid, BarraOrina[playerid]);
  45. DestroyProgressBar(BarraOrina[playerid]);
  46. KillTimer(MatarOrina[playerid][1]);
  47. KillTimer(MatarOrina[playerid][2]);
  48. EstasOrinando[playerid] = 0;
  49. return 1;
  50. }
  51.  
  52. public OnPlayerSpawn(playerid)
  53. {
  54. ShowProgressBarForPlayer(playerid, BarraOrina[playerid]);
  55. return 1;
  56. }
  57.  
  58. public OnPlayerDeath(playerid, killerid, reason)
  59. {
  60. if(EstasOrinando[playerid] == 1)
  61. {
  62. SetPlayerSpecialAction(playerid,SPECIAL_ACTION_NONE);
  63. EstasOrinando[playerid] = 0;
  64. KillTimer(MatarOrina[playerid][2]);
  65. return 1;
  66. }
  67. return 1;
  68. }
  69.  
  70. COMMAND:orinar(playerid, params[])
  71. {
  72. new string[128], name[MAX_PLAYER_NAME+1];
  73. GetPlayerName(playerid, name, sizeof(name));
  74. if(LlenarOrina[playerid] <= 50) return SendClientMessage(playerid, COLOR_GRAD2, "Usted no tiene ganas de orinar.");
  75. if(EstasOrinando[playerid] == 1) return SendClientMessage(playerid, COLOR_GRAD2, "Usted ya está orinando.");
  76. format(string, sizeof(string), "%s se baja el cierre de su pantalón y comienza a orinar.", name);
  77. ProxDetector(20.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  78. MatarOrina[playerid][2] = SetTimerEx("BajandorBarraOrina", TIEMPO_EN_ORINA, true, "i", playerid);
  79. EstasOrinando[playerid] = 1;
  80. return 1;
  81. }
  82.  
  83. forward BajandorBarraOrina(playerid);
  84. public BajandorBarraOrina(playerid)
  85. {
  86. new s[128], name[MAX_PLAYER_NAME+1];
  87. GetPlayerName(playerid, name, sizeof(name));
  88. LlenarOrina[playerid] --;
  89. SetProgressBarValue(BarraOrina[playerid], LlenarOrina[playerid]);
  90. UpdateProgressBar(BarraOrina[playerid], playerid);
  91. SetPlayerSpecialAction(playerid,SPECIAL_ACTION_PISSING);
  92. switch(LlenarOrina[playerid])
  93. {
  94. case 5:
  95. {
  96. SetPlayerSpecialAction(playerid,SPECIAL_ACTION_NONE);
  97. LlenarOrina[playerid] = 0;
  98. EstasOrinando[playerid] = 0;
  99. KillTimer(MatarOrina[playerid][2]);
  100. format(s, sizeof(s), "%s para de orinar y se sube el cierre de su pantalón.", name);
  101. ProxDetector(20.0, playerid, s, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  102. }
  103. }
  104. return 1;
  105. }
  106.  
  107. forward ActualizarBarraOrina(playerid);
  108. public ActualizarBarraOrina(playerid)
  109. {
  110. new s[128], name[MAX_PLAYER_NAME+1];
  111. GetPlayerName(playerid, name, sizeof(name));
  112. LlenarOrina[playerid] ++;
  113. SetProgressBarValue(BarraOrina[playerid], LlenarOrina[playerid]);
  114. UpdateProgressBar(BarraOrina[playerid], playerid);
  115. switch(LlenarOrina[playerid])
  116. {
  117. case 50: {
  118. format(s, sizeof(s), "Atención %s: Usted tiene un nivel de orina de 50%%, vaya a orinar o se orinará involuntariamente.", name);
  119. SendClientMessage(playerid, -1, s);
  120. SendClientMessage(playerid, COLOR_GRAD2, "Utilice: /orinar");
  121. }
  122. case 60: {
  123. format(s, sizeof(s), "Atención %s: Usted tiene un nivel de orina de 60%%, vaya a orinar o se orinará involuntariamente.", name);
  124. SendClientMessage(playerid, -1, s);
  125. SendClientMessage(playerid, COLOR_GRAD2, "Utilice: /orinar");
  126. }
  127. case 80: {
  128. format(s, sizeof(s), "Atención %s: Usted tiene un nivel de orina de 80%%, vaya a orinar o se orinará involuntariamente.", name);
  129. SendClientMessage(playerid, -1, s);
  130. SendClientMessage(playerid, COLOR_GRAD2, "Utilice: /orinar");
  131. }
  132. case 100: {
  133. LlenarOrina[playerid] = 0;
  134. format(s, sizeof(s), "%s se orina involuntariamente, debido a que no aguantó.", name);
  135. ProxDetector(20.0, playerid, s, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  136. SendClientMessage(playerid, -1, "¡Oh! {FF0000}se ha orinado encima. {FFFFFF}Que desilusión, la próxima vez evite ésto.");
  137. }
  138. }
  139. return 1;
  140. }
  141.  
  142. forward ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5);
  143. public ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5)
  144. {
  145. if(IsPlayerConnected(playerid))
  146. {
  147. new Float:posx, Float:posy, Float:posz;
  148. new Float:oldposx, Float:oldposy, Float:oldposz;
  149. new Float:tempposx, Float:tempposy, Float:tempposz;
  150. GetPlayerPos(playerid, oldposx, oldposy, oldposz);
  151. for(new i = 0; i < MAX_PLAYERS; i++)
  152. {
  153. if(IsPlayerConnected(i) && (GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(i)))
  154. {
  155. GetPlayerPos(i, posx, posy, posz);
  156. tempposx = (oldposx -posx);
  157. tempposy = (oldposy -posy);
  158. tempposz = (oldposz -posz);
  159. 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
  160. {
  161. SendClientMessage(i, col1, string);
  162. }
  163. else if (((tempposx < radi/8) && (tempposx > -radi/8)) && ((tempposy < radi/8) && (tempposy > -radi/8)) && ((tempposz < radi/8) && (tempposz > -radi/8))) // within 8 meters
  164. {
  165. SendClientMessage(i, col2, string);
  166. }
  167. else if (((tempposx < radi/4) && (tempposx > -radi/4)) && ((tempposy < radi/4) && (tempposy > -radi/4)) && ((tempposz < radi/4) && (tempposz > -radi/4))) //4 meters
  168. {
  169. SendClientMessage(i, col3, string);
  170. }
  171. else if (((tempposx < radi/2) && (tempposx > -radi/2)) && ((tempposy < radi/2) && (tempposy > -radi/2)) && ((tempposz < radi/2) && (tempposz > -radi/2))) //2 meters
  172. {
  173. SendClientMessage(i, col4, string);
  174. }
  175. else if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi))) //1 meter
  176. {
  177. SendClientMessage(i, col5, string);
  178. }
  179. }
  180. else
  181. {
  182. SendClientMessage(i, col1, string);
  183. }
  184. }
  185. }
  186. return 1;
  187. }
  188.  
  189. COMMAND:test1(playerid, params[])
  190. {
  191. LlenarOrina[playerid] = 0;
  192. LlenarOrina[playerid] = 49;
  193. return 1;
  194. }
  195. COMMAND:test2(playerid, params[])
  196. {
  197. LlenarOrina[playerid] = 0;
  198. LlenarOrina[playerid] = 59;
  199. return 1;
  200. }
  201. COMMAND:test3(playerid, params[])
  202. {
  203. LlenarOrina[playerid] = 0;
  204. LlenarOrina[playerid] = 79;
  205. return 1;
  206. }
  207. COMMAND:test4(playerid, params[])
  208. {
  209. LlenarOrina[playerid] = 0;
  210. LlenarOrina[playerid] = 99;
  211. return 1;
  212. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement