CoD 4 Radar Streak
#1

Hi all...i want to do a radar streak for my war server like in CoD 4 but i having some problems with the code...
So i have 2 teams Team Russia and Team Army
If 1 of the player in the team kills 3 enemy he get a radar streak for 15 seconds.After this he will able to see PlayerMarkers on the map of the enemy team.after 15 seconds the Radar streak pass away...If someone could make this script for me i very thanks it...
sorry all for my bad english :S
Reply
#2

On OnPlayerDeath, check if there is a kill and add an incrementing value to that (So it knows its 3+ kills)

Example:
pawn Код:
new RadarTimer[MAX_PLAYERS];
forward Radar(playerid);
public OnPlayerDeath(playerid, killerid, reason) {
    new string[50];
    if (GetPlayerTeam(killerid) != GetPlayerTeam(playerid)) {
        SetPVarInt(killerid, "RadarKills", GetPVarInt(killerid, "RadarKills") + 1);
        if (GetPVarInt(killerid, "RadarKills") >= 3) {
            format(string, 50, "%s has gained the Radar Perk!", Name(killerid));
            SendClientMessageToAll(COLOR_GREEN, string);
            RadarTimer[killerid] = SetTimerEx("Radar", 15000, 0, "i", killerid);
            //However your player markers is set up
            for (new i = 0; i < MAX_PLAYERS; i++) {
                SetPlayerMarkerForPlayer(killerid, i, GetPlayerColor(i));
            }
        }
    }
    return 1;
}
public Radar(playerid) {
    new string[50];
    format(string, 50, "%s's Radar Perk has expired!", Name(playerid));
    SendClientMessageToAll(COLOR_RED, string);
    //However your player markers is set up
    for (new i = 0; i < MAX_PLAYERS; i++) {
        SetPlayerMarkerForPlayer(playerid, i, 0xFFFFFF00);
    }
    SetPVarInt(playerid, "RadarKills", 0);
    KillTimer(RadarTimer[playerid]);
    return 1;
}
stock Name(playerid) { new s[20]; GetPlayerName(playerid, s, 20); return s; }
Reply
#3

Thank you for your reply and help... But if i kill 3 enemy i dont get message that i get a radar perk, i dont get that my radar perk expired...and i always see the enemy tag-s on my minimap...So could you help me again? or someone?thank you
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)