Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //by Bpb..Alone. Version 1.0 from 08 Jule 2010.
- enum Dropi
- {
- dID,
- dAmmo,
- Float:dPos[3],
- dRespawnDealy,
- dWorldID,
- dTimer
- }
- new Drop[MAX_PICKUPS][Dropi];
- new WeaponModel[47] = {
- 0,
- 331,//1
- 333,//2
- 334,//3
- 335,//4
- 336,//5
- 337,//6
- 338,//7
- 339,//8
- 341,//9
- 321,//10
- 322,//11
- 323,//12
- 324,//13
- 325,//14
- 326,//15
- 342,//16
- 343,//17
- 344,//18
- 1212,//19, money
- 1240,//20, health
- 1242,//21, armour
- 346,//22
- 347,//23
- 348,//24
- 349,//25
- 350,//26
- 351,//27
- 352,//28
- 353,//29
- 355,//30
- 356,//31
- 372,//32
- 357,//33
- 358,//34
- 359,//35
- 360,//36
- 361,//37
- 362,//38
- 363,//39
- 364,//40
- 365,//41
- 366,//42
- 367,//43
- 368,//44
- 369,//45
- 371 //46
- };
- forward aPickups_Create(weaponid, ammo, Float:x, Float:y, Float:z, respawn_dealy, destroy_time, world);
- public aPickups_Create(weaponid, ammo, Float:x, Float:y, Float:z, respawn_dealy, destroy_time, world)
- {
- if(weaponid > 46 || weaponid < 1) return -1;
- new dropid = CreatePickup(WeaponModel[weaponid], 23, x, y, z, world);
- Drop[dropid][dID] = weaponid;
- Drop[dropid][dAmmo] = ammo;
- Drop[dropid][dWorldID] = world;
- Drop[dropid][dPos][0] = x, Drop[dropid][dPos][1] = y, Drop[dropid][dPos][2] = z;
- if(respawn_dealy > 0) Drop[dropid][dRespawnDealy] = respawn_dealy;
- else if(destroy_time > 0) Drop[dropid][dTimer] = SetTimerEx("aPickups_Destroy", destroy_time*1000, 0, "d", dropid);
- return dropid;
- }
- forward aPickups_Destroy(dropid);
- public aPickups_Destroy(dropid)
- {
- DestroyPickup(dropid);
- KillTimer(Drop[dropid][dTimer]);
- if(Drop[dropid][dRespawnDealy] > 0) SetTimerEx("aPickups_Create",Drop[dropid][dRespawnDealy]*1000, 0,
- "ddfffddd", Drop[dropid][dID], Drop[dropid][dAmmo], Drop[dropid][dPos][0], Drop[dropid][dPos][1], Drop[dropid][dPos][2],
- Drop[dropid][dRespawnDealy], 0, Drop[dropid][dWorldID]);
- Drop[dropid][dID] = 0;
- Drop[dropid][dAmmo] = 0;
- Drop[dropid][dRespawnDealy] = 0;
- }
- forward aPickups_OnPlayerPickUpPickup(playerid, pickupid);
- public aPickups_OnPlayerPickUpPickup(playerid, pickupid)
- {
- if(GetPlayerState(playerid) == 1)
- {
- if(Drop[pickupid][dID] == 19)
- {
- GivePlayerMoney(playerid, Drop[pickupid][dAmmo]);
- }
- else if(Drop[pickupid][dID] == 20)
- {
- new Float:tempsupervariable1;
- GetPlayerHealth(playerid, tempsupervariable1);
- SetPlayerHealth(playerid, tempsupervariable1+Drop[pickupid][dAmmo]);
- if(tempsupervariable1+Drop[pickupid][dAmmo] > 100) SetPlayerHealth(playerid, 100.0);
- }
- else if(Drop[pickupid][dID] == 21)
- {
- new Float:tempsupervariable1;
- GetPlayerArmour(playerid, tempsupervariable1);
- SetPlayerArmour(playerid, tempsupervariable1+Drop[pickupid][dAmmo]);
- if(tempsupervariable1+Drop[pickupid][dAmmo] > 100) SetPlayerArmour(playerid, 100.0);
- }
- else
- {
- GivePlayerWeapon(playerid, Drop[pickupid][dID], Drop[pickupid][dAmmo]);
- }
- aPickups_Destroy(pickupid);
- }
- return 1;
- }
- /*
- native aPickups_Create(weaponid, ammo, Float:x, Float:y, Float:z, respawn_dealy, destroy_time, world);
- native aPickups_Destroy(dropid);
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement