12.12.2011, 17:47
This is what happens when I die, I'm not spawning correctly and not using the correct skin.
public OnPlayerDeath(playerid, killerid, reason) { SetPVarInt(playerid, "timeofdeath", gettime()); // Store time of death if(IsPlayerConnected(killerid)) { if(killerid != playerid) { if(AdminDuty[playerid]) { if(!AdminDuty[killerid]) { GivePlayerCash(playerid,-1); } } SetPlayerWantedLevelEx(killerid,GetPlayerWantedLevelEx(playerid)+0); } } return 1; }
public OnPlayerSpawn(playerid) { if(gPlayerLogged[playerid]) { SetPlayerSpawn(playerid); SetPlayerSkin(playerid,PlayerInfo[playerid][pSkin]); } if(gettime()-GetPVarInt(playerid, "timeofdeath") < 10) // If the player died less than 10 seconds ago { SetPlayerFacingAngle(playerid, 0); SetPlayerDrunkLevel(playerid, 3000); // Subtle swaying camera for 'dizzy' effect SetPlayerSkin(playerid,PlayerInfo[playerid][pSkin]); // uses skin SendClientMessage(playerid,COLOR_FADE3, "----------------------------------------------------------"); SendClientMessage(playerid,COLOR_GREEN, "You were criticly injured and rushed to APMC."); SendClientMessage(playerid,COLOR_FADE3, "----------------------------------------------------------"); SetPlayerPos(playerid, 2358.6711, -94.1742, 27.4059); // Spawn at hospital } return 1; }
public OnPlayerSpawn(playerid) { if(gPlayerLogged[playerid]) { SetPlayerSpawn(playerid); SetPlayerSkin(playerid,PlayerInfo[playerid][pSkin]); } else if(gettime()-GetPVarInt(playerid, "timeofdeath") < 10) // If the player died less than 10 seconds ago { SetPlayerFacingAngle(playerid, 0); SetPlayerDrunkLevel(playerid, 3000); // Subtle swaying camera for 'dizzy' effect SetPlayerSkin(playerid,PlayerInfo[playerid][pSkin]); // uses skin SendClientMessage(playerid,COLOR_FADE3, "----------------------------------------------------------"); SendClientMessage(playerid,COLOR_GREEN, "You were criticly injured and rushed to APMC."); SendClientMessage(playerid,COLOR_FADE3, "----------------------------------------------------------"); SetPlayerPos(playerid, 2358.6711, -94.1742, 27.4059); // Spawn at hospital } return 1; }