World Boundries - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP (
https://sampforum.blast.hk/forumdisplay.php?fid=3)
+--- Forum: Bug Reports (
https://sampforum.blast.hk/forumdisplay.php?fid=20)
+--- Thread: World Boundries (
/showthread.php?tid=303272)
World Boundries -
vincee - 12.12.2011
This is what happens when I die, I'm not spawning correctly and not using the correct skin.
Re: World Boundries -
skullmuncher1337 - 12.12.2011
When you die? Show your OnPlayerDeath/OnPlayerSpawn parts which have to do with setting a players coords. Make sure you didn't forget a "." for example: 987990 -> 987.990
Re: World Boundries -
vincee - 12.12.2011
Still broke. [EDIT]
Re: World Boundries -
vincee - 14.12.2011
Код:
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;
}
Re: World Boundries -
vincee - 14.12.2011
I forgot to mention that when I die I spawn at the civilian spawn point I set but with CJ skin and when I relog I spawn there instead of faction.
Re: World Boundries -
vincee - 14.12.2011
Maybe because I never but "else" on the check to see if the player is spawning or dying...
Re: World Boundries -
vincee - 14.12.2011
hmmm when I die it sends me to my spawn
Код:
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;
}
Re: World Boundries -
MP2 - 14.12.2011
I have fixed this for him over Teamviewer - he had no classes (AddPlayerClass never used).