[HELP] lower life
#4

pawn Код:
C:\Users\Usuario\Desktop\The walking dead Primera Temporada\gamemodes\Thewalkingdead.pwn(7717) : error 017: undefined symbol "GetDistanceBetweenPlayers"
add
pawn Код:
stock GetDistanceBetweenPlayers(playerid,playerid2)
{
    new Float:x1,Float:y1,Float:z1,Float:x2,Float:y2,Float:z2;
    new Float:tmpdis;
    GetPlayerPos(playerid,x1,y1,z1);
    GetPlayerPos(playerid2,x2,y2,z2);
    tmpdis = floatsqroot(floatpower(floatabs(floatsub(x2,x1)),2)+floatpower(floatabs(floatsub(y2,y1)),2)+floatpower(floatabs(floatsub(z2,z1)),2));
    return floatround(tmpdis);
}
somewhere at the end of your script.



It also had some errors. Fixed them now
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) //enter shop
{
    new playerid2;
    new Health = GetPlayerHealth(playerid2);
    if(newkeys == 128)
    {
        if(gTeam[playerid] == TEAM_ZOMBIES)
        {
            if(GetDistanceBetweenPlayers(playerid,playerid2) < 3)
            {
                if(gTeam[playerid2] !=TEAM_ZOMBIES)
                {
                SetPlayerHealth(playerid2, Health-10);
                }
            }
        }
    }
    return 1;
}


stock GetDistanceBetweenPlayers(playerid,playerid2)
{
    new Float:x1,Float:y1,Float:z1,Float:x2,Float:y2,Float:z2;
    new Float:tmpdis;
    GetPlayerPos(playerid,x1,y1,z1);
    GetPlayerPos(playerid2,x2,y2,z2);
    tmpdis = floatsqroot(floatpower(floatabs(floatsub(x2,x1)),2)+floatpower(floatabs(floatsub(y2,y1)),2)+floatpower(floatabs(floatsub(z2,z1)),2));
    return floatround(tmpdis);
}
Reply


Messages In This Thread
[HELP] lower life - by Bocha - 31.03.2014, 15:47
Re: [HELP] lower life - by ZeroTheScyther - 31.03.2014, 16:37
Respuesta: [HELP] lower life - by Bocha - 31.03.2014, 16:42
Re: [HELP] lower life - by ZeroTheScyther - 31.03.2014, 16:45
Respuesta: [HELP] lower life - by Bocha - 31.03.2014, 17:06
Re: [HELP] lower life - by ZeroTheScyther - 31.03.2014, 17:07
Respuesta: [HELP] lower life - by Bocha - 31.03.2014, 17:17
Respuesta: [HELP] lower life - by Bocha - 01.04.2014, 02:07
Re: [HELP] lower life - by Crayder - 01.04.2014, 03:31
Re: [HELP] lower life - by ZeroTheScyther - 01.04.2014, 12:16

Forum Jump:


Users browsing this thread: 1 Guest(s)