DuskXtremeX

SAMP DeathMatch v1.0.1

Jul 24th, 2014
257
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // I am not a PRO in scripting, So if you find any bugs, inform me kindly and I'll check it out.
  2. // Catch me @ Facebook : www.facebook.com/pmanoj.pandu || Twitter : @L0V3R30Y ||
  3. // Follow me @Instagram : mjay768
  4. // My website  : https://www.techngaming.co.in
  5. // This is not yet finished, Still trying to make it better. So If you have any suggestions, I'm happy to hear from you.
  6. // E-Mail me your suggestions at [email protected]
  7.  
  8. #include <a_samp>
  9. #include <zcmd>
  10. #include <streamer>
  11. //#pragma tabsize 0
  12. new message[301];
  13. new InDM[MAX_PLAYERS];
  14. new cn;
  15.  
  16. new health;
  17. new weapon;
  18. new armour;
  19. new Float:Spawns[][]= {
  20.    {-2491.8706,-237.2221,39.3019,295.0867},
  21.    {-2482.0308,-283.6506,40.5421,180.7190},
  22.    {-2444.0479,-271.4679,35.6237,258.4264},
  23.    {-2490.9055,-298.6101,35.8574,172.5956},
  24.    {-2525.5771,-313.8878,39.0723,327.6012},
  25.    {-2554.4729,-291.1451,25.9594,118.0751}
  26. };
  27.  
  28. new weaps[][] = {
  29.    {22},
  30.    {23},
  31.    {24},
  32.    {25},
  33.    {26},
  34.    {27},
  35.    {28},
  36.    {29},
  37.    {30},
  38.    {31},
  39.    {32}
  40. };
  41. public OnPlayerConnect(playerid)
  42. {
  43.     InDM[playerid] =0;
  44.     return 1;
  45. }
  46. public OnPlayerDisconnect(playerid, reason)
  47. {
  48.     InDM[playerid] =0;
  49.     return 1;
  50. }
  51.  
  52. COMMAND:dm(playerid,params[])
  53. {
  54.  if(InDM[playerid] ==0)
  55.  {
  56.    InDM[playerid] =1;
  57.    cn++;
  58.    ResetPlayerWeapons(playerid);
  59.    new r = random(50);
  60.    SetPlayerSkin(playerid, r);
  61.    new Random = random(sizeof(Spawns));
  62.    SetPlayerPos(playerid, Spawns[Random][0],Spawns[Random][1],Spawns[Random][2]);
  63.    SetPlayerFacingAngle(playerid, Spawns[Random][3]);
  64.    new Random1 = random(sizeof(weaps));
  65.    GivePlayerWeapon(playerid, weaps[Random1][0], 150);
  66.    
  67.  }
  68. }
  69. public OnPlayerDeath(playerid, killerid, reason)
  70. {
  71.  
  72.     SendDeathMessage(killerid, playerid, reason);
  73.     if(InDM[playerid] == 1)
  74.     {
  75.       new kill[256];
  76.       format(kill, sizeof(kill),"%s killed %s in DM",killerid,playerid);
  77.     }
  78.     cn -=1;
  79.     if(cn ==1)
  80.     {
  81.      new winner[50];
  82.      GetPlayerName(playerid, winner,MAX_PLAYER_NAME); //To store the last player name
  83.      new fwinner[100]; //string to announce winner
  84.      format(fwinner, sizeof(fwinner)," %s has won the DM[Minigame]",winner);
  85.     }
  86.     return 1;
  87. }
  88.  
  89. public OnPlayerPickUpPickup(playerid, pickupid)
  90. {
  91.     if(pickupid == health)
  92.     {
  93.       new Float:phealth;
  94.       GetPlayerHealth(playerid, phealth);
  95.       SetPlayerHealth(playerid, phealth+70);
  96.     }
  97.     else if(pickupid == weapon)
  98.     {
  99.       new ammo;
  100.       GetPlayerAmmo(ammo);
  101.       if(ammo<150)
  102.       {
  103.        GivePlayerWeapon(playerid, 29, 150);
  104.       }
  105.     }
  106.     else if(pickupid == armour)
  107.     {
  108.       new Float:pArmour;
  109.       GetPlayerArmour(playerid, pArmour);
  110.       SetPlayerArmour(playerid, pArmour+50);
  111.     }
  112.     return 1;
  113. }
Advertisement
Add Comment
Please, Sign In to add comment