Guest User

Untitled

a guest
Feb 20th, 2017
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.35 KB | None | 0 0
  1. public OnPlayerSpawn(playerid)
  2. {
  3. if(IsDead[playerid])
  4. {
  5. pInfo[playerid][pHealth] = 95;
  6. pInfo[playerid][pArmor] = 0;
  7. IsDead[playerid] = false;
  8. }
  9. if(CurrentWeapon[playerid] != -1)
  10. {
  11. GivePlayerWeapon(playerid, CurrentWeapon[playerid], CurrentAmmo[playerid]);
  12. }
  13. SetPlayerHealth(playerid, pInfo[playerid][pHealth]);
  14. SetPlayerArmour(playerid, pInfo[playerid][pArmor]);
  15. SetPlayerColor(playerid, COLOR_WHITE);
  16. if(IsPlayerAttachedObjectSlotUsed(playerid, 1)) RemovePlayerAttachedObject(playerid, 1);
  17. if(IsPlayerAttachedObjectSlotUsed(playerid, 8)) RemovePlayerAttachedObject(playerid, 8);
  18. CallLocalFunction("PlayerEquip", "i", playerid);
  19. IsPlayerLoggedIn[playerid] = true;
  20. new count;
  21. for(new i=0; i<MAX_PLAYERS; i++)
  22. {
  23. if(IsPlayerConnected(i) && IsPlayerLoggedIn[i]) count++;
  24. }
  25. if(MaxPlayers < count)
  26. {
  27. SCMA(COLOR_GREEN, "The server has reached a new max player count!");
  28. MaxPlayers = count;
  29. CallLocalFunction("SaveServer","i",0);
  30. }
  31. for(new i=0; i<11; i++)
  32. {
  33. SetPlayerSkillLevel(playerid, i, 1);
  34. }
  35.  
  36. //DELETE
  37. for(new i=0; i<100; i++)
  38. {
  39. new Float:x, Float:y, Float:z;
  40. x = pInfo[playerid][pX] + i;
  41. y = pInfo[playerid][pY];
  42. z = pInfo[playerid][pZ];
  43. CallLocalFunction("CreateLoot", "iifff", random(54)+1, random(51), x, y, z);
  44. }
  45. return 1;
  46. }
Advertisement
Add Comment
Please, Sign In to add comment