Help me please , fix error PLAYER_STATE_ALIVE
#1

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);
}
}
}

Reply
#2

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.
Reply
#3

Код:
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;
}
Reply
#4

Thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)