Guest User

Untitled

a guest
Dec 8th, 2012
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.72 KB | None | 0 0
  1. new Float:DeathX[MAX_PLAYERS],Float:DeathY[MAX_PLAYERS],Float:DeathZ[MAX_PLAYERS];
  2. new Tot[MAX_PLAYERS];
  3. new DeathTimer[MAX_PLAYERS];
  4.  
  5. public OnPlayerSpawn(playerid)
  6. {
  7. if(GetPVarInt(playerid,"FirstSpawn") == 1 && Tot[playerid] == 0)
  8. {
  9. SetPlayerScore(playerid,Spieler[playerid][pLevel]);
  10. SetPVarInt(playerid,"FirstSpawn",0);
  11. SetPlayerPos(playerid,-2765.1836,375.2714,6.3359);
  12. SetPlayerFacingAngle(playerid,269.5055);
  13. SetPlayerSkin(playerid,7);
  14. Spieler[playerid][pSkin] = 7;
  15. SetPlayerColor(playerid,COLOR_GRAU);
  16. }
  17. else if(GetPVarInt(playerid,"Spawn") == 1 && Tot[playerid] == 0)
  18. {
  19. new pfad[88];
  20. format(pfad,sizeof(pfad),"/Positionen/%s.txt",Spieler[playerid][pName]);
  21. if(fexist(pfad))
  22. {
  23. SetPlayerPos(playerid,dini_Float(pfad,"LastX"),dini_Float(pfad,"LastY"),dini_Float(pfad,"LastZ"));
  24. SetPlayerInterior(playerid,dini_Int(pfad,"Interior"));
  25. }
  26. GivePlayerMoney(playerid,Spieler[playerid][pGeld]);
  27. SetPlayerSkin(playerid,Spieler[playerid][pSkin]);
  28. SetPVarInt(playerid,"Spawn",0);
  29. }
  30. else if(Tot[playerid] == 1)
  31. {
  32. SetPlayerPos(playerid,0,0,0);
  33. SetPlayerCameraPos(playerid,DeathX[playerid],DeathY[playerid],DeathX[playerid]);
  34. SetPlayerCameraLookAt(playerid, 324.34, 54.122, 173.35);
  35. TogglePlayerControllable(playerid,0);
  36. }
  37. return 1;
  38. }
  39.  
  40. public OnPlayerDeath(playerid, killerid, reason)
  41. {
  42. Tot[playerid] = 1;
  43. Spieler[playerid][pTode] += 1;
  44. Spieler[killerid][pKills] += 1;
  45. KillTimer(DeathTimer[playerid]);
  46. return 1;
  47. }
  48.  
  49. forward Death(playerid);
  50. public Death(playerid)
  51. {
  52. for(new i;i<MAX_PLAYERS;i++)
  53. {
  54. if(GetPVarInt(i,"Eingeloggt") == 1 && Tot[i] == 0)
  55. {
  56. new Float:X,Float:Y,Float:Z;
  57. GetPlayerPos(i,X,Y,Z);
  58. DeathX[i] = X;
  59. DeathY[i] = Y;
  60. DeathZ[i] = Z;
  61. }
  62. }
  63. }
Advertisement
Add Comment
Please, Sign In to add comment