/*
DeathPos by Adams aka (Light, ElectroX, eLeMeNt)
Miben segit a script?
A script segitsegevel oda tersz vissza ahol meghaltal.Abban az esettben ha
most leptel fel a szerverre normalisan letesz a szerveren levo hangon
Parancsok:
/dp - amivel be illetve ki tudod kapcsolni a DeathPos-t
Hasznald egeszseggel
*/
#include <a_samp>
forward spawnplayer(playerid);
new Float:xpos,Float:ypos,Float:zpos,death[MAX_PLAYERS],enableddeathpos[MAX_PLAYERS];
public OnPlayerConnect(playerid)
{
death[playerid] = 0;
enableddeathpos[playerid] = 1;
new str[50],pname[MAX_PLAYER_NAME];
format(str,sizeof(str),\"Hello %s,DeathPos Script by Adams Betoltve\",pname);
SendClientMessage(playerid, 0x0033ffAA, str);
SendClientMessage(playerid, 0x0033ffAA,\"Ha szeretned ki/be kapcsolni a deathpost ird:/dp\");
SendClientMessage(playerid, 0x0033ffAA,\"A script segitsegevel oda spawnolsz ahol meghaltal!\");
return 1;
}
public OnPlayerSpawn(playerid)
{
if(enableddeathpos[playerid] == 1) {
if(death[playerid] == 1) {
/*SetPlayerPos(playerid, xpos, ypos, zpos);
death[playerid] = 0;*/
SetTimer(\"spawnplayer\", 100, 0);
}
}
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, \"/dp\", true))
{
if(enableddeathpos[playerid] == 1) {
enableddeathpos[playerid] = 0;
SendClientMessage(playerid, 0x0033ffAA, \"DeathPos:{ff0015}OFF\");
} else {
enableddeathpos[playerid] = 1;
SendClientMessage(playerid, 0x0033ffAA, \"DeathPos:{55ff00}ON\");
}
return 1;
}
return 0;
}
public OnPlayerDeath(playerid, killerid, reason)
{
GetPlayerPos(playerid, xpos, ypos, zpos);
death[playerid] = 1;
return 1;
}
public spawnplayer(playerid)
{
new dpstring[150];
SetPlayerPos(playerid, xpos, ypos, zpos);
death[playerid] = 0;
SendClientMessage(playerid, 0x0033ffAA, \"Itt haltal meg azaz ide spawnolsz:\");
format(dpstring,sizeof(dpstring),\"X:%d,Y:%d,Z:%d\",xpos,ypos,zpos);
SendClientMessage(playerid, 0x0033ffAA, dpstring);
return 1;
}