Advertisement
Niko_Hs

[FS]AntiFall V.10 By Niko_Hs

Aug 4th, 2011
222
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 9.62 KB | None | 0 0
  1. //===========================================>DESCRIZIONE<======================
  2. // • Anti Caduta - V.1
  3. // • Usa /AFAttiva /AFDisattiva.
  4. // • Ributta il player sulla moto.
  5. // • Possibilità Di Non cadere dalla moto.
  6. // • Spawna moto tramite menù /moto.
  7. // • Non Rimuovere i Crediti. FilterScript Copyright Ufficiale ©.
  8. //===========================================>INCLUDE<==========================
  9.  
  10. #include <a_samp>
  11. //===========================================>FILTERSCRIPT<=====================
  12.  
  13. #define FILTERSCRIPT
  14. #if defined FILTERSCRIPT
  15. //===========================================>FORWARD<==========================
  16.  
  17. forward msgauto();
  18. //===========================================>NEWS<=============================
  19.  
  20. new Menu:MotoMenu;
  21. new MODELLO[MAX_PLAYERS];
  22. new AZIONE[MAX_PLAYERS];
  23. new DENTRO[MAX_PLAYERS];
  24. new msg = 0;
  25. //===========================================>DEFINE<===========================
  26.  
  27. #define PASSEGERO 1           //2
  28. #define GUIDA 0
  29. //===========================================>COLORI<===========================
  30. #define VERDE 0x00FF00AA
  31. #define BIANCO 0xFFFFFFAA                //COLORI ITALIANI
  32. #define ROSSO 0xFF0000AA
  33. //===========================================>INIT<=============================
  34.  
  35. public OnFilterScriptInit()
  36. {
  37. print("--------------------------------");
  38. print(" N - Anti Fall Niko_Hs™ ");
  39. print(" Versione Numero 1 ");
  40. print(" Caricato ");
  41. print("--------------------------------");
  42. SetTimer("msgauto", 60000, 1);
  43.  
  44. MotoMenu = CreateMenu("MotoMenu", 1, 200.0, 100.0, 150.0, 150.0);
  45. AddMenuItem(MotoMenu, 0, "Nrg-500");
  46. AddMenuItem(MotoMenu, 0, "Fcr-900");
  47. AddMenuItem(MotoMenu, 0, "Pcj-600");
  48. AddMenuItem(MotoMenu, 0, "Bf-400");
  49. AddMenuItem(MotoMenu, 0, "HPV1000");
  50. AddMenuItem(MotoMenu, 0, "PizzaBoy");
  51. AddMenuItem(MotoMenu, 0, "Faggio");
  52. AddMenuItem(MotoMenu, 0, "Quad");
  53. AddMenuItem(MotoMenu, 0, "Freeway");
  54. return 1;
  55. }
  56. //===========================================>EXIT<=============================
  57. public OnFilterScriptExit()
  58. {
  59. print(" N - Anti Fall Niko_Hs™ ");
  60. print(" Versione Numero 1 ");
  61. print(" Chiuso ");
  62. return 1;
  63. }
  64. //===========================================>END<==============================
  65.  
  66. #endif
  67. //===========================================>COMANDI<==========================
  68.  
  69. public OnPlayerCommandText(playerid, cmdtext[])
  70. {
  71. //===========================================>ATTIVA<===========================
  72.  
  73. if (strcmp("/AfAttiva", cmdtext, true) == 0)
  74. {
  75. SendClientMessage(playerid, VERDE, "{00FF00}Hai Attivato {FFFFFF}L'Anti-Caduta. {FF0000}Usa (/AfDisattiva) Per Disattivare");
  76. GameTextForPlayer(playerid, "~h~~g~Anti ~h~~w~Caduta ~h~~r~Attivato!",5000,5);
  77. new name[MAX_PLAYER_NAME], string[256];
  78. GetPlayerName(playerid, name, sizeof(name));
  79. format(string, sizeof(string), "{00FF00}%s {FFFFFF}Ha Attivato {FF0000}L'Anti-Caduta! (/AfAttiva)",name);
  80. SendClientMessageToAll(BIANCO, string);
  81. AZIONE[playerid] = 1;
  82. return 1;
  83. }
  84. //===========================================>DISATTIVA<========================
  85.  
  86. if (strcmp("/AfDisattiva", cmdtext, true) == 0)
  87. {
  88. SendClientMessage(playerid, ROSSO, "{00FF00}Hai Disattivato {FFFFFF}L'Anti-Caduta. {FF0000}Usa (/AfAttiva) Per Attivare.");
  89. GameTextForPlayer(playerid, "~h~~g~Anti ~h~~w~Caduta ~h~~r~Disattivato!",5000,5);
  90. new name[MAX_PLAYER_NAME], string[256];
  91. GetPlayerName(playerid, name, sizeof(name));
  92. format(string, sizeof(string), "{00FF00}%s {FFFFFF}Ha Disattivato {FF0000}L'Anti-Caduta! (/AfDisattiva)",name);
  93. SendClientMessageToAll(VERDE, string);
  94. AZIONE[playerid] = 0;
  95. return 1;
  96. }
  97.  
  98. //===========================================>INFO.CMD<=========================
  99.  
  100. if (strcmp("/infoaf", cmdtext, true, 10) == 0)
  101. {
  102. SendClientMessage(playerid, VERDE, "___|[FS] By Niko_Hs™|___");
  103. SendClientMessage(playerid, BIANCO, "[TUTTI I COMANDI]: ");
  104. SendClientMessage(playerid, ROSSO, "[ATTIVA] : /AFATTIVA");
  105. SendClientMessage(playerid, VERDE, "[DISATTIVA] : /AFDISATTIVA");
  106. SendClientMessage(playerid, BIANCO, "[INFO] : Attivando l'anti-caduta non puoi cadere dai veicoli.");
  107. SendClientMessage(playerid, ROSSO, "[INFO] : Disattivando l'anti-caduta puoi cadere dai veicoli.");
  108. SendClientMessage(playerid, VERDE, "[INFO.VEICOLO] : Usa /Moto per avere una moto tramite menù.");
  109. return 1;
  110. }
  111. //===========================================>MENU MOTO.CMD<====================
  112.  
  113. //MENU
  114.  
  115. if (strcmp(cmdtext, "/Moto",true)==0)
  116. {
  117. if(!IsPlayerInAnyVehicle(playerid))
  118. {
  119. ShowMenuForPlayer(MotoMenu,playerid);
  120. }
  121. else
  122. {
  123. SendClientMessage(playerid,ROSSO,"Sei Già in un Veicolo!");
  124. }
  125. return 1;
  126. }
  127.  
  128. return 0;
  129. }
  130. //===========================================>MSG.AUTO<=========================
  131. public msgauto() {
  132. switch (msg) {
  133. case 0: SendClientMessageToAll(VERDE, "Attiva o Disattiva L'Anti-Caduta, /afattiva /afdisattiva, prendi veicolo con /moto."), msg = 1;
  134. case 1: SendClientMessageToAll(VERDE, "Anti-Caduta leggi più info /Infoaf"), msg = 0;
  135. }
  136. }
  137. //===========================================>STATE.CHANGE<=====================
  138.  
  139. public OnPlayerStateChange(playerid, newstate, oldstate)  //Azione
  140. {
  141. //===========================================>GUIDA<============================
  142.  
  143. if(AZIONE[playerid] == 1)
  144. {
  145. if(oldstate == PLAYER_STATE_DRIVER)
  146. {
  147. if(newstate == PLAYER_STATE_ONFOOT)
  148. {
  149. if(DENTRO[playerid] == 1) //Funzione
  150. {
  151. PutPlayerInVehicle(playerid, MODELLO[playerid], GUIDA); //Dentro
  152. }
  153. }
  154. }
  155. //===========================================>PASSEGERO<========================
  156.  
  157. if(oldstate == PLAYER_STATE_PASSENGER)
  158. {
  159. if(newstate == PLAYER_STATE_ONFOOT)
  160. {
  161. if(DENTRO[playerid] == 1) //Automatico
  162. {
  163. PutPlayerInVehicle(playerid, MODELLO[playerid], PASSEGERO); //Dentro
  164. }
  165. }
  166. }
  167. //===========================================>FUNZIONE.AUTO<====================
  168.  
  169. if(oldstate == PLAYER_STATE_ONFOOT)
  170. {
  171. if(newstate == PLAYER_STATE_DRIVER || PLAYER_STATE_PASSENGER)
  172. {
  173. DENTRO[playerid] = 1; //Automatico
  174. MODELLO[playerid] = GetPlayerVehicleID(playerid);  //Modello
  175. }
  176. }
  177. }
  178. return 1;
  179. }
  180. //===========================================>EXIT.V<===========================
  181.  
  182. public OnPlayerExitVehicle(playerid, vehicleid) //Rientra Automaticamente
  183. {
  184. DENTRO[playerid] = 0; //Funzione
  185. return 1;
  186. }
  187. //===========================================>EXIT.M<===========================
  188.  
  189. public OnPlayerExitedMenu(playerid)
  190. {
  191. return 1;
  192. }
  193. //===========================================>SELEZIONE<========================
  194.  
  195. public OnPlayerSelectedMenuRow(playerid, row)
  196. {
  197. new Menu:CurrentMenu = GetPlayerMenu(playerid);
  198. if(CurrentMenu == MotoMenu)
  199. {
  200. switch(row)
  201. {
  202.  
  203. case 0: //Nrg-500
  204. {
  205. new Float:x;new Float:y;new Float:z;
  206. GetPlayerPos(playerid, x, y, z);
  207. new nrg;
  208. nrg=CreateVehicle(522, x+3, y, z, 900.00, -1, -1, 120);
  209. PutPlayerInVehicle(playerid, nrg,0);
  210. SendClientMessage(playerid, VERDE, "Hai spawnato una Nrg-500");
  211. }
  212. //==============================================================================
  213. case 1: //Fcr-900
  214. {
  215. new Float:x;new Float:y;new Float:z;
  216. GetPlayerPos(playerid, x, y, z);
  217. new FCR;
  218. FCR=CreateVehicle(521, x+3, y, z, 900.00, -1, -1, -1);
  219. PutPlayerInVehicle(playerid, FCR,0);
  220. SendClientMessage(playerid, VERDE, "Hai spawnato una Fcr-900");
  221. }
  222. //==============================================================================
  223. case 2: //Pcj-600
  224. {
  225. new Float:x;new Float:y;new Float:z;
  226. GetPlayerPos(playerid, x, y, z);
  227. new PCJ;
  228. PCJ=CreateVehicle(461, x+3, y, z, 900.00, -1, -1, -1);
  229. PutPlayerInVehicle(playerid, PCJ,0);
  230. SendClientMessage(playerid, VERDE, "Hai spawnato una Pcj-600");
  231. }
  232. //==============================================================================
  233. case 3: //Bf-400
  234. {
  235. new Float:x;new Float:y;new Float:z;
  236. GetPlayerPos(playerid, x, y, z);
  237. new bf;
  238. bf=CreateVehicle(581, x+3, y, z, 900.00, -1, -1, -1);
  239. PutPlayerInVehicle(playerid, bf,0);
  240. SendClientMessage(playerid, VERDE, "Hai spawnato una Bf-400");
  241. }
  242. //==============================================================================
  243. case 4: //HPV1000
  244. {
  245. new Float:x;new Float:y;new Float:z;
  246. GetPlayerPos(playerid, x, y, z);
  247. new HPV1000;
  248. HPV1000=CreateVehicle(523, x+3, y, z, 900.00, -1, -1, -1);
  249. PutPlayerInVehicle(playerid, HPV1000,0);
  250. SendClientMessage(playerid, VERDE, "Hai spawnato una HPV1000");
  251. }
  252. //==============================================================================
  253. case 5: //Pizzaboy
  254. {
  255. new Float:x;new Float:y;new Float:z;
  256. GetPlayerPos(playerid, x, y, z);
  257. new pizzaboy;
  258. pizzaboy=CreateVehicle(448, x+3, y, z, 900.00, -1, -1, -1);
  259. PutPlayerInVehicle(playerid, pizzaboy,0);
  260. SendClientMessage(playerid, VERDE, "Hai spawnato un PizzaBoy");
  261. }
  262. //==============================================================================
  263. case 6: //Faggio
  264. {
  265. new Float:x;new Float:y;new Float:z;
  266. GetPlayerPos(playerid, x, y, z);
  267. new faggio;
  268. faggio=CreateVehicle(462, x+3, y, z, 900.00, -1, -1, -1);
  269. PutPlayerInVehicle(playerid, faggio,0);
  270. SendClientMessage(playerid, VERDE, "Hai spawnato un Faggio");
  271. }
  272. //==============================================================================
  273. case 7: //Quad
  274. {
  275. new Float:x;new Float:y;new Float:z;
  276. GetPlayerPos(playerid, x, y, z);
  277. new quad;
  278. quad=CreateVehicle(471, x+3, y, z, 900.00, -1, -1, -1);
  279. PutPlayerInVehicle(playerid, quad,0);
  280. SendClientMessage(playerid, VERDE, "Hai spawnato un Quad");
  281. }
  282. //==============================================================================
  283. case 8: //FreeWay
  284. {
  285. new Float:x;new Float:y;new Float:z;
  286. GetPlayerPos(playerid, x, y, z);
  287. new freeway;
  288. freeway=CreateVehicle(463, x+3, y, z, 900.00, -1, -1, -1);
  289. PutPlayerInVehicle(playerid, freeway,0);
  290. SendClientMessage(playerid, VERDE, "Hai spawnato una FreeWay");
  291. }
  292. }
  293. }
  294. return 1;
  295. }
  296. //===========================================>FINE<=============================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement