Advertisement
Guest User

Alone Weapon Pickups - v1.0 [08 Jule 2010]

a guest
Jul 8th, 2010
333
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 3.03 KB | None | 0 0
  1. //by Bpb..Alone. Version 1.0 from 08 Jule 2010.
  2.  
  3. enum Dropi
  4. {
  5.     dID,
  6.     dAmmo,
  7.     Float:dPos[3],
  8.     dRespawnDealy,
  9.     dWorldID,
  10.     dTimer
  11. }
  12.  
  13. new Drop[MAX_PICKUPS][Dropi];
  14.  
  15. new WeaponModel[47] = {
  16.     0,
  17.     331,//1
  18.     333,//2
  19.     334,//3
  20.     335,//4
  21.     336,//5
  22.     337,//6
  23.     338,//7
  24.     339,//8
  25.     341,//9
  26.     321,//10
  27.     322,//11
  28.     323,//12
  29.     324,//13
  30.     325,//14
  31.     326,//15
  32.     342,//16
  33.     343,//17
  34.     344,//18
  35.     1212,//19, money
  36.     1240,//20, health
  37.     1242,//21, armour
  38.     346,//22
  39.     347,//23
  40.     348,//24
  41.     349,//25
  42.     350,//26
  43.     351,//27
  44.     352,//28
  45.     353,//29
  46.     355,//30
  47.     356,//31
  48.     372,//32
  49.     357,//33
  50.     358,//34
  51.     359,//35
  52.     360,//36
  53.     361,//37
  54.     362,//38
  55.     363,//39
  56.     364,//40
  57.     365,//41
  58.     366,//42
  59.     367,//43
  60.     368,//44
  61.     369,//45
  62.     371 //46
  63. };
  64.  
  65. forward aPickups_Create(weaponid, ammo, Float:x, Float:y, Float:z, respawn_dealy, destroy_time, world);
  66. public aPickups_Create(weaponid, ammo, Float:x, Float:y, Float:z, respawn_dealy, destroy_time, world)
  67. {
  68.     if(weaponid > 46 || weaponid < 1) return -1;
  69.     new dropid = CreatePickup(WeaponModel[weaponid], 23, x, y, z, world);
  70.     Drop[dropid][dID] = weaponid;
  71.     Drop[dropid][dAmmo] = ammo;
  72.     Drop[dropid][dWorldID] = world;
  73.     Drop[dropid][dPos][0] = x, Drop[dropid][dPos][1] = y, Drop[dropid][dPos][2] = z;
  74.     if(respawn_dealy > 0) Drop[dropid][dRespawnDealy] = respawn_dealy;
  75.     else if(destroy_time > 0) Drop[dropid][dTimer] = SetTimerEx("aPickups_Destroy", destroy_time*1000, 0, "d", dropid);
  76.     return dropid;
  77. }
  78.  
  79. forward aPickups_Destroy(dropid);
  80. public aPickups_Destroy(dropid)
  81. {
  82.     DestroyPickup(dropid);
  83.     KillTimer(Drop[dropid][dTimer]);
  84.     if(Drop[dropid][dRespawnDealy] > 0) SetTimerEx("aPickups_Create",Drop[dropid][dRespawnDealy]*1000, 0,
  85.     "ddfffddd", Drop[dropid][dID], Drop[dropid][dAmmo], Drop[dropid][dPos][0], Drop[dropid][dPos][1], Drop[dropid][dPos][2],
  86.     Drop[dropid][dRespawnDealy], 0, Drop[dropid][dWorldID]);
  87.     Drop[dropid][dID] = 0;
  88.     Drop[dropid][dAmmo] = 0;
  89.     Drop[dropid][dRespawnDealy] = 0;
  90. }
  91.  
  92. forward aPickups_OnPlayerPickUpPickup(playerid, pickupid);
  93. public aPickups_OnPlayerPickUpPickup(playerid, pickupid)
  94. {
  95.     if(GetPlayerState(playerid) == 1)
  96.     {
  97.         if(Drop[pickupid][dID] == 19)
  98.         {
  99.             GivePlayerMoney(playerid, Drop[pickupid][dAmmo]);
  100.         }
  101.         else if(Drop[pickupid][dID] == 20)
  102.         {
  103.             new Float:tempsupervariable1;
  104.             GetPlayerHealth(playerid, tempsupervariable1);
  105.             SetPlayerHealth(playerid, tempsupervariable1+Drop[pickupid][dAmmo]);
  106.             if(tempsupervariable1+Drop[pickupid][dAmmo] > 100) SetPlayerHealth(playerid, 100.0);
  107.         }
  108.         else if(Drop[pickupid][dID] == 21)
  109.         {
  110.             new Float:tempsupervariable1;
  111.             GetPlayerArmour(playerid, tempsupervariable1);
  112.             SetPlayerArmour(playerid, tempsupervariable1+Drop[pickupid][dAmmo]);
  113.             if(tempsupervariable1+Drop[pickupid][dAmmo] > 100) SetPlayerArmour(playerid, 100.0);
  114.         }
  115.         else
  116.         {
  117.             GivePlayerWeapon(playerid, Drop[pickupid][dID], Drop[pickupid][dAmmo]);
  118.         }
  119.         aPickups_Destroy(pickupid);
  120.     }
  121.     return 1;
  122. }
  123.  
  124. /*
  125. native aPickups_Create(weaponid, ammo, Float:x, Float:y, Float:z, respawn_dealy, destroy_time, world);
  126. native aPickups_Destroy(dropid);
  127. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement