SA-MP Forums Archive
Help me please , fix error PLAYER_STATE_ALIVE - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Help me please , fix error PLAYER_STATE_ALIVE (/showthread.php?tid=658224)



Help me please , fix error PLAYER_STATE_ALIVE - linhpro200294 - 27.08.2018

Ai know fix this error help me with please?


Error:

Quote:

./includes/perp.pwn(99081) : error 017: undefined symbol "PLAYER_STATE_ALIVE"
./includes/perp.pwn(99084) : error 017: undefined symbol "PLAYER_STATE_ALIVE"

Code:

Quote:

public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart)
{
if(issuerid != INVALID_PLAYER_ID) {
new Float:health;

PlayerInfo[playerid][pLastDamagetime] = gettime();
GetPlayerHealth(playerid, health);

if(GetPlayerTeam(playerid) != PLAYER_STATE_ALIVE && PlayerInfo[playerid][pDeaths])
SetPlayerHealth(playerid, health);

if(GetPlayerTeam(playerid) == PLAYER_STATE_ALIVE)
{
if(health - amount <= 30.0)
{
SendClientMessage(playerid, COLOR_LIGHTRED, "-> Suc khoe thap, ky nang ban sung o muc do trung binh.");
SetPlayerSkillLevel(playerid, WEAPONSKILL_PISTOL, 200);
SetPlayerSkillLevel(playerid, WEAPONSKILL_AK47, 200);
SetPlayerSkillLevel(playerid, WEAPONSKILL_DESERT_EAGLE, 200);
SetPlayerSkillLevel(playerid, WEAPONSKILL_SHOTGUN, 200);
SetPlayerSkillLevel(playerid, WEAPONSKILL_M4, 200);
SetPlayerSkillLevel(playerid, WEAPONSKILL_MP5, 200);
}
}
}




Re: Help me please , fix error PLAYER_STATE_ALIVE - Sew_Sumi - 27.08.2018

There is no such state.

https://sampwiki.blast.hk/wiki/Playerstates

Quote:
Originally Posted by wiki
Код:
7	PLAYER_STATE_WASTED	Player is dead or on class selection
8	PLAYER_STATE_SPAWNED	Player is spawned

Actually, what the heck are you even trying to do?

Код:
if(GetPlayerTeam(playerid) == PLAYER_STATE_ALIVE)
There is absolutely no way, this will ever work as you may think it will.


Re: Help me please , fix error PLAYER_STATE_ALIVE - UFF - 30.08.2018

Код:
GetPlayerTeam(playerid)
GetPlayerTeam is to get the player's team which he belongs.You would have used SetPlayerTeam to set player team.

Example Code:
Код:
new team[MAX_PLAYERS];
#define TEAM1 1
CMD:team(playerid)
{
team[playerid] = TEAM1; 
SetPlayerTeam(playerid, team[playerid]); // This function will set the player team.
return 1;
}

CMD:myteam(playerid)
{
if(GetPlayerTeam(playerid) == TEAM1) // To Get the Player team (TEAM1) using GetPlayerTeam.
{
   SendClientMessage(playerid, -1, "Your team is TEAM1");
}

return 1;
}



Re: Help me please , fix error PLAYER_STATE_ALIVE - linhpro200294 - 01.09.2018

Thanks