SA-MP Forums Archive
UAV - 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: UAV (/showthread.php?tid=198754)



UAV - Kitten - 13.12.2010

Solved


Re: UAV - admantis - 13.12.2010

pawn Код:
CMD:uav(playerid, params[])
{
    if (Kills[playerid] > 2)
    {
        ShowPlayerMarkers(2);
        SetTimer("UAVGONE",9000,false); // 9 second
        return 1;
    }
    else return 0; // or error message
}



Re: UAV - Mauzen - 13.12.2010

And of course end the killstreak of the killed player:

SetPVarInt(playerid, "Kills", 0);


Re: UAV - Joe_ - 13.12.2010

Increase the PVAR kills by one for killerid everytime he kills somebody, then check if he has X amount of kills when he types /uav.

You're better off using the normal array method than pvars for things like that though, because pvars are just slower, and are only usefull for sharing across scripts, I also found you can't save pvars under OnPlayerDisconnect, or that might have been a mistake on my side.

To make a PVAR go up (example for killerid, put under OnPlayerDeath)

pawn Код:
SetPVarInt(killerid, "Kills", GetPVarInt(killerid, "Kills") + 1);
And to check what his kills are:

pawn Код:
if(GetPVarInt(playerid, "Kills") >= 3) // More or equals to 3 kills
As I said, you could just use the normal array method.

pawn Код:
pData[killerid][Kills]++;
pawn Код:
if(pData[playerid][Kills] >= 3)



Re: UAV - xMaGmOtAnEtHx - 17.08.2012

nice. u think i can make other killstreaks? like airstrike, nuke, or something
btw do i put this in a Filterscript?