Advertisement
GustavoAraujo

Save Weapons

Nov 1st, 2013
512
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 0.96 KB | None | 0 0
  1. //Code to save weapons
  2. new bool: PickWeapons[MAX_PLAYERS]; // Top
  3.  
  4. public OnPlayerDisconnect(playerid, reason)
  5. {
  6.     new Arma[13], Bala[13],Arma_[20],Bala_[20];
  7.     for(new i = 0; i < 13; i++)
  8.     {
  9.         GetPlayerWeaponData(playerid,i,Arma[i],Bala[i]);
  10.         format(Arma_,20,"Arma%d",i);
  11.         format(Bala_,20,"Bala%d",i);
  12.         DOF2_SetInt(GetarConta(playerid), Arma_, Arma[i]);
  13.         DOF2_SetInt(GetarConta(playerid), Bala_, Bala[i]);
  14.     }
  15.     PickWeapons[playerid] = false;
  16.     return 1;
  17. }
  18.  
  19. public OnPlayerSpawn(playerid)
  20. {
  21.     if(!PickWeapons[playerid])
  22.     {
  23.         new Arma_[20],Bala_[20];
  24.         for(new i = 0; i > 13; i++)
  25.         {
  26.             format(Arma_, 20,"Arma%d",i);
  27.             format(Bala_,20,"Bala%d",i);
  28.             GivePlayerWeapon(playerid,DOF2_GetInt(GetarConta(playerid),Arma_),DOF2_GetInt(GetarConta(playerid),Bala_));
  29.         }
  30.         PickWeapons[playerid] = true;
  31.         return 1;
  32.     }
  33.     return 1;
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement