Guest User

I-INC (iFarbod's functions)

a guest
Mar 13th, 2014
249
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 5.25 KB | None | 0 0
  1. /*----------------------------------------------------------------------------*\
  2.                     =======================================
  3.                       I.INC - Useful defs and functions
  4.                     =======================================
  5. \*----------------------------------------------------------------------------*/
  6.  
  7. /* =========  DEFINES ========= */
  8.  
  9. // Colors
  10. #define COLOR_DEFAULT 0xE6E6E6FF
  11. #define COLOR_PRIMARY 0x3071A9FF
  12. #define COLOR_SUCCESS 0x449D44FF
  13. #define COLOR_INFO 0x31B0D5FF
  14. #define COLOR_WARNING 0xEC971FFF
  15. #define COLOR_DANGER 0xC9302CFF
  16.  
  17. /* =========  NATIVES ========= */
  18. // native WP_Hash(buffer[], len, const str[]);
  19.  
  20. /* =========  VARIABLES ========= */
  21. // Vehicle names array
  22. new VehicleNames[212][] = {
  23. {"Landstalker"},{"Bravura"},{"Buffalo"},{"Linerunner"},{"Perrenial"},{"Sentinel"},{"Dumper"},
  24. {"Firetruck"},{"Trashmaster"},{"Stretch"},{"Manana"},{"Infernus"},{"Voodoo"},{"Pony"},{"Mule"},
  25. {"Cheetah"},{"Ambulance"},{"Leviathan"},{"Moonbeam"},{"Esperanto"},{"Taxi"},{"Washington"},
  26. {"Bobcat"},{"Mr Whoopee"},{"BF Injection"},{"Hunter"},{"Premier"},{"Enforcer"},{"Securicar"},
  27. {"Banshee"},{"Predator"},{"Bus"},{"Rhino"},{"Barracks"},{"Hotknife"},{"Trailer 1"},{"Previon"},
  28. {"Coach"},{"Cabbie"},{"Stallion"},{"Rumpo"},{"RC Bandit"},{"Romero"},{"Packer"},{"Monster"},
  29. {"Admiral"},{"Squalo"},{"Seasparrow"},{"Pizzaboy"},{"Tram"},{"Trailer 2"},{"Turismo"},
  30. {"Speeder"},{"Reefer"},{"Tropic"},{"Flatbed"},{"Yankee"},{"Caddy"},{"Solair"},{"Berkley's RC Van"},
  31. {"Skimmer"},{"PCJ-600"},{"Faggio"},{"Freeway"},{"RC Baron"},{"RC Raider"},{"Glendale"},{"Oceanic"},
  32. {"Sanchez"},{"Sparrow"},{"Patriot"},{"Quad"},{"Coastguard"},{"Dinghy"},{"Hermes"},{"Sabre"},
  33. {"Rustler"},{"ZR-350"},{"Walton"},{"Regina"},{"Comet"},{"BMX"},{"Burrito"},{"Camper"},{"Marquis"},
  34. {"Baggage"},{"Dozer"},{"Maverick"},{"News Chopper"},{"Rancher"},{"FBI Rancher"},{"Virgo"},{"Greenwood"},
  35. {"Jetmax"},{"Hotring"},{"Sandking"},{"Blista Compact"},{"Police Maverick"},{"Boxville"},{"Benson"},
  36. {"Mesa"},{"RC Goblin"},{"Hotring Racer A"},{"Hotring Racer B"},{"Bloodring Banger"},{"Rancher"},
  37. {"Super GT"},{"Elegant"},{"Journey"},{"Bike"},{"Mountain Bike"},{"Beagle"},{"Cropdust"},{"Stunt"},
  38. {"Tanker"}, {"Roadtrain"},{"Nebula"},{"Majestic"},{"Buccaneer"},{"Shamal"},{"Hydra"},{"FCR-900"},
  39. {"NRG-500"},{"HPV1000"},{"Cement Truck"},{"Tow Truck"},{"Fortune"},{"Cadrona"},{"FBI Truck"},
  40. {"Willard"},{"Forklift"},{"Tractor"},{"Combine"},{"Feltzer"},{"Remington"},{"Slamvan"},
  41. {"Blade"},{"Freight"},{"Streak"},{"Vortex"},{"Vincent"},{"Bullet"},{"Clover"},{"Sadler"},
  42. {"Firetruck LA"},{"Hustler"},{"Intruder"},{"Primo"},{"Cargobob"},{"Tampa"},{"Sunrise"},{"Merit"},
  43. {"Utility"},{"Nevada"},{"Yosemite"},{"Windsor"},{"Monster A"},{"Monster B"},{"Uranus"},{"Jester"},
  44. {"Sultan"},{"Stratum"},{"Elegy"},{"Raindance"},{"RC Tiger"},{"Flash"},{"Tahoma"},{"Savanna"},
  45. {"Bandito"},{"Freight Flat"},{"Streak Carriage"},{"Kart"},{"Mower"},{"Duneride"},{"Sweeper"},
  46. {"Broadway"},{"Tornado"},{"AT-400"},{"DFT-30"},{"Huntley"},{"Stafford"},{"BF-400"},{"Newsvan"},
  47. {"Tug"},{"Trailer 3"},{"Emperor"},{"Wayfarer"},{"Euros"},{"Hotdog"},{"Club"},{"Freight Carriage"},
  48. {"Trailer 3"},{"Andromada"},{"Dodo"},{"RC Cam"},{"Launch"},{"Police Car (LSPD)"},{"Police Car (SFPD)"},
  49. {"Police Car (LVPD)"},{"Police Ranger"},{"Picador"},{"S.W.A.T. Van"},{"Alpha"},{"Phoenix"},{"Glendale"},
  50. {"Sadler"},{"Luggage Trailer A"},{"Luggage Trailer B"},{"Stair Trailer"},{"Boxville"},{"Farm Plow"},
  51. {"Utility Trailer"}
  52. };
  53.  
  54. /* =========  FUNCTIONS ========= */
  55. // Gives the player health point (increase and decrease)
  56. // example : GivePlayerHealth(killerid, 9);
  57. // or GivePlayerHealth(issuerid, -99);
  58. stock GivePlayerHealth(playerid, Float:health)
  59. {
  60.     new Float:playerhealth;
  61.     GetPlayerHealth(playerid, playerhealth);
  62.     SetPlayerHealth(playerid, playerhealth+health);
  63. }
  64.  
  65. // Gives the player armour point (increase and decrease)
  66. // example : GivePlayerArmour(killerid, 9);
  67. // or GivePlayerArmour(issuerid, -99);
  68. stock GivePlayerArmour(playerid, Float:armour)
  69. {
  70.     new Float:playerarmour;
  71.     GetPlayerArmour(playerid, playerarmour);
  72.     SetPlayerArmour(playerid, playerhealth+armour);
  73. }
  74.  
  75. stock GivePlayerScore(playerid, score)
  76. {
  77.     new playerscore = GetPlayerScore(playerid);
  78.     SetPlayerScore(playerid, playerscore+score);
  79. }
  80.  
  81. // sets the money instantly
  82. stock SetPlayerMoney(playerid, money)
  83. {
  84.     ResetPlayerMoney(playerid);
  85.     GivePlayerMoney(playerid, money);
  86. }
  87.  
  88. // usage :
  89. // GivePlayerWantedLevel(playerid, 5);
  90. // GivePlayerWantedLevel(playerid, -2);
  91. stock GivePlayerWantedLevel(playerid, level)
  92. {
  93.     new pwlevel = GetPlayerWantedLevel(playerid);
  94.     SetPlayerWantedLevel(playerid, pwlevel+level);
  95. }
  96.  
  97. // optional function but i always use GetPlayerName()
  98. // strings without length are deprecated
  99. stock PlayerName(playerid)
  100. {
  101.     new playaname[MAX_PLAYER_NAME];
  102.     GetPlayerName(playerid, playaname, sizeof(playaname));
  103.     return playaname;
  104. }
  105.  
  106. stock IsCarLowrider(vehiclemodelid)
  107. {
  108.     new iLowriders[] = {412, 534, 535, 536, 566, 567, 575, 576};
  109.     for(new i = 0; i < sizeof(iLowriders); i++)
  110.     {
  111.         if(GetVehicleModel(vehiclemodelid) == iLowriders[i]) return 1;
  112.     }
  113.     return 0;
  114. }
  115.  
  116. stock PlaySoundForAll(soundid, Float:x, Float:y, Float:z)
  117. {
  118.     for(new i; i < MAX_PLAYERS; i ++)
  119.     {
  120.         if(IsPlayerConnected(i))
  121.         {
  122.             PlayerPlaySound(i, soundid, x, y, z);
  123.         }
  124.     }
  125. }
Advertisement
Add Comment
Please, Sign In to add comment