SA-MP Forums Archive
Infected Will this work - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Infected Will this work (/showthread.php?tid=187085)



Infected Will this work - Kitten - 31.10.2010

Solved


Re: Infected Will this work - Kitten - 31.10.2010

any help?


Re: Infected Will this work - Jaxson - 01.11.2010

Why don't you test it? I'll be glad to help if you need a partner.


Re: Infected Will this work - Zamaroht - 01.11.2010

It will infect the person who clicks.


Re: Infected Will this work - (SF)Noobanatior - 01.11.2010

you will have to be on the zombie team and have a knife to become infected

what are you trying to do? infect the person that gets stabbed?


Re: Infected Will this work - Kitten - 01.11.2010

Quote:
Originally Posted by (SF)Noobanatior
Посмотреть сообщение
you will have to be on the zombie team and have a knife to become infected

what are you trying to do? infect the person that gets stabbed?
Yes exactly what im trying to do


Re: Infected Will this work - ViruZZzZ_ChiLLL - 01.11.2010

Would work on strtok I think.
IsPlayerInRangeOfPoint (The player that will be stabbed or playerid2) then get your pos GetPlayerPos
I think...


Re: Infected Will this work - Kitten - 01.11.2010

Solved


Re: Infected Will this work - ViruZZzZ_ChiLLL - 01.11.2010

Well I never really learned strtok. But here's a concept :

pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if(cTeam[playerid] == ZOMBIE)
        if(newkeys & KEY_FIRE)
        {
            if(GetPlayerWeapon(playerid) == 4)
            {
                new Float:x, Float:y, Float:z;
                GetPlayerPos(playerid, x, y, z);
                if(IsPlayerInRangeOfPoint(playerid2, x+2, y+2, z)) return Infected(playerid2);
                return 1;
            }

        }

    return 1;
}
Just use strtok for the detection of playerid2


Re: Infected Will this work - (SF)Noobanatior - 01.11.2010

its tricky to see what player is attacking who b4 they die
so you would need to check for players that are real close and if there health changes when you stab them,then infect them

something like
Код:
new float:zx,float:zy,float:zz;
GetPlayerPoz(playerid,zx,zy,zz);
for new(z=0;z<MAX_PLAYERS,z++){
 if(!IsPlayerConnected(z))continue;
 if(IsPlayerInRangeOfPoint(z,zx,zy,zz){
  GetPlayerHealth(z,zh[playerid]);
 }
}
then check in a few seconds if the health has gone down if so infect them

an easer way to do it would be if you just infect them if there health is low and they are near you would have pretty much the same effect

^^^^NOT WORKING CODE just a example