SA-MP Forums Archive
Zombie Pickups problem - 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: Zombie Pickups problem (/showthread.php?tid=372797)



Zombie Pickups problem - Sanady - 28.08.2012

Hello.I made something new in my server.But it`s not working....When zombie kill survivor.Pickup will create just for zombies.But problem is in that pickup will create for everybody.Also when zombie enter to pickup it won`t get XP just they get nothing.How to fix it?Createpickup just for zombies.And when zombie enter to pickup to get XP?

code:
pawn Код:
new meso;

public OnPlayerDeath(playerid, killerid, reason)
{
        if(gPlayerClass[killerid] == CZOMBIE)
        {
            new Float:X,Float:Y,Float:Z;
            GetPlayerPos(playerid,X,Y,Z);
            if(GetPlayerTeam(killerid) == 2)
            {
                meso = CreatePickup(2804,2,X,Y,Z,-1);
            }
        }
        return 1;
}
public OnPlayerPickUpPickup(playerid, pickupid)
{
    if(pickup == meso)
    {
        if(GetPlayerTeam(playerid) == 2)
        {
            GameTextForPlayer(playerid,"+20",5000,4);
            UserStats[playerid][Exp] += 20;
        }
    }
    return 1;
}



Re: Zombie Pickups problem - Youice - 28.08.2012

try this:

pawn Код:
public OnPlayerUpdate(playerid)
{
    if(GetPlayerTeam(playerid) == 1)//change it to humans team
    {
        DestroyPickup(meso);
    }
    return 1;
}
Edit: try to add a command that checks the team, you might be (ig) something else not team "2"


Re: Zombie Pickups problem - Sanady - 28.08.2012

Quote:
Originally Posted by Youice
Посмотреть сообщение
try this:

pawn Код:
public OnPlayerUpdate(playerid)
{
    if(GetPlayerTeam(playerid) == 1)//change it to humans team
    {
        DestroyPickup(meso);
    }
    return 1;
}
Edit: try to add a command that checks the team, you might be (ig) something else not team "2"
It`s still not working anyone else?


Re: Zombie Pickups problem - Lordzy - 28.08.2012

Try this
pawn Код:
new meso;

public OnPlayerDeath(playerid, killerid, reason)
{
        if(gPlayerClass[killerid] == CZOMBIE)
        {
            new Float:X,Float:Y,Float:Z;
            GetPlayerPos(playerid,X,Y,Z);
            if(GetPlayerTeam(killerid) == 2)
            {
                meso = CreatePickup(2804,2,X,Y,Z,-1);
            }
        }
        return 1;
}
public OnPlayerPickUpPickup(playerid, pickupid)
{
    if(pickup == meso)
    {
        if(GetPlayerTeam(playerid) == 2)
        {
            GameTextForPlayer(playerid,"+20",5000,4);
            UserStats[playerid][Exp] + 20;
        }
    }
    return 1;
}



Re: Zombie Pickups problem - Sanady - 28.08.2012

Quote:
Originally Posted by [xB]Lordz
Посмотреть сообщение
Try this
pawn Код:
new meso;

public OnPlayerDeath(playerid, killerid, reason)
{
        if(gPlayerClass[killerid] == CZOMBIE)
        {
            new Float:X,Float:Y,Float:Z;
            GetPlayerPos(playerid,X,Y,Z);
            if(GetPlayerTeam(killerid) == 2)
            {
                meso = CreatePickup(2804,2,X,Y,Z,-1);
            }
        }
        return 1;
}
public OnPlayerPickUpPickup(playerid, pickupid)
{
    if(pickup == meso)
    {
        if(GetPlayerTeam(playerid) == 2)
        {
            GameTextForPlayer(playerid,"+20",5000,4);
            UserStats[playerid][Exp] + 20;
        }
    }
    return 1;
}
Sorry but this is not working (( anyone else??