whiplk

[FS] - GunGame

Jul 12th, 2013
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.55 KB | None | 0 0
  1. forward setInitDefault(pl);
  2. new
  3.     bool:gPlayerStart [ MAX_PLAYERS ] ,
  4.     gPlayerWeapon [ MAX_PLAYERS ] ;
  5.  
  6. public OnPlayerDeath(playerid, killerid, reason)
  7. {
  8.     if (killerid != INVALID_PLAYER_ID)
  9.     {
  10.         if (gPlayerWeapon [ killerid ] == 9)
  11.         {
  12.             setWinner(killerid);
  13.             return 1;
  14.         }
  15.         gPlayerWeapon [ killerid ] ++ ;
  16.         setWeaponUpgrade(killerid, gPlayerWeapon [ killerid ])
  17.     }
  18. }
  19.  
  20. new bool:gPm [ MAX_PLAYERS ] ;
  21. public OnPlayerDeath(playerid, killerid, reason)
  22. {
  23.     gPm [ playerid ] = 1;
  24. }
  25.  
  26. public OnPlayerSpawn(playerid)
  27. {
  28.     if (gPm [ playerid ])
  29.     {
  30.         SetPlayerPos(playerid, x, y, z); //x, y, z = posição do hospital
  31.         gPm [ playerid ] = 0;
  32.     }
  33. }
  34.  
  35. public OnPlayerConnect(playerid)
  36. {
  37.     gPlayerStart [ playerid ] = true;
  38.     SetTimerEx("setInitDefault", 5000, 0, "i", playerid);
  39. }
  40.  
  41. stock setWinner(pl)
  42. {
  43.     //Mensagem de vitória, parabenização, dinheiro, essas coisas.
  44. }
  45.  
  46. public setInitDefault(pl)
  47. {
  48.     SpawnPlayer(pl);
  49.     SetPlayerPos(pl, x, y, z); //Mudar x, y, z pelas coordenadas desejadas
  50.     setWeaponUpgrade(pl, 0);
  51. }
  52.  
  53. stock setWeaponUpgrade(pl, wp)
  54. {
  55.     switch(wp)
  56.     {
  57.         case 1: GivePlayerWeapon(pl, 22, 9999);
  58.         case 2: GivePlayerWeapon(pl, 25, 9999);
  59.         case 3: GivePlayerWeapon(pl, 28, 9999);
  60.         case 4: GivePlayerWeapon(pl, 29, 9999);
  61.         case 5: GivePlayerWeapon(pl, 32, 9999);
  62.         case 6: GivePlayerWeapon(pl, 30, 9999);
  63.         case 7: GivePlayerWeapon(pl, 31, 9999);
  64.         case 8: GivePlayerWeapon(pl, 34, 9999);
  65.         case 9: GivePlayerWeapon(pl, 35, 9999);
  66.         default: GivePlayerWeapon(pl, 4, 1);
  67.     }
  68. }
Advertisement
Add Comment
Please, Sign In to add comment