Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- new Float:DeathX[MAX_PLAYERS],Float:DeathY[MAX_PLAYERS],Float:DeathZ[MAX_PLAYERS];
- new Tot[MAX_PLAYERS];
- new DeathTimer[MAX_PLAYERS];
- public OnPlayerSpawn(playerid)
- {
- if(GetPVarInt(playerid,"FirstSpawn") == 1 && Tot[playerid] == 0)
- {
- SetPlayerScore(playerid,Spieler[playerid][pLevel]);
- SetPVarInt(playerid,"FirstSpawn",0);
- SetPlayerPos(playerid,-2765.1836,375.2714,6.3359);
- SetPlayerFacingAngle(playerid,269.5055);
- SetPlayerSkin(playerid,7);
- Spieler[playerid][pSkin] = 7;
- SetPlayerColor(playerid,COLOR_GRAU);
- }
- else if(GetPVarInt(playerid,"Spawn") == 1 && Tot[playerid] == 0)
- {
- new pfad[88];
- format(pfad,sizeof(pfad),"/Positionen/%s.txt",Spieler[playerid][pName]);
- if(fexist(pfad))
- {
- SetPlayerPos(playerid,dini_Float(pfad,"LastX"),dini_Float(pfad,"LastY"),dini_Float(pfad,"LastZ"));
- SetPlayerInterior(playerid,dini_Int(pfad,"Interior"));
- }
- GivePlayerMoney(playerid,Spieler[playerid][pGeld]);
- SetPlayerSkin(playerid,Spieler[playerid][pSkin]);
- SetPVarInt(playerid,"Spawn",0);
- }
- else if(Tot[playerid] == 1)
- {
- SetPlayerPos(playerid,0,0,0);
- SetPlayerCameraPos(playerid,DeathX[playerid],DeathY[playerid],DeathX[playerid]);
- SetPlayerCameraLookAt(playerid, 324.34, 54.122, 173.35);
- TogglePlayerControllable(playerid,0);
- }
- return 1;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- Tot[playerid] = 1;
- Spieler[playerid][pTode] += 1;
- Spieler[killerid][pKills] += 1;
- KillTimer(DeathTimer[playerid]);
- return 1;
- }
- forward Death(playerid);
- public Death(playerid)
- {
- for(new i;i<MAX_PLAYERS;i++)
- {
- if(GetPVarInt(i,"Eingeloggt") == 1 && Tot[i] == 0)
- {
- new Float:X,Float:Y,Float:Z;
- GetPlayerPos(i,X,Y,Z);
- DeathX[i] = X;
- DeathY[i] = Y;
- DeathZ[i] = Z;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment