Help with this command!
#1

Well firstly i got this command from samp wiki
pawn Код:
dcmd_heal(playerid, params[])
{
    new id;
    if (sscanf(params, "u", id)) SendClientMessage(playerid, 0xFF0000AA, "Usage: \"/heal <playerid>\"");
    else if (id == INVALID_PLAYER_ID) SendClientMessage(playerid, 0xFF0000AA, "Player not found");
    else
    {
        SetPlayerHealth(id, 100.0);
        SendClientMessage(id, 0x00FF00AA, "You have been healed");
        SendClientMessage(playerid, 0x00FF00AA, "Player healed");
    }
    return 1;
}
I want to make this command work if you are in the medics team..
I'm using gteam for this!
Reply
#2

pawn Код:
dcmd_heal(playerid, params[])
{
    new id;
    if (sscanf(params, "u", id)) SendClientMessage(playerid, 0xFF0000AA, "Usage: \"/heal <playerid>\"");
    else if (id == INVALID_PLAYER_ID) SendClientMessage(playerid, 0xFF0000AA, "Player not found");
     else if (gTeam[playerid] != Team_Medic) SendClientMessage(playerid, 0xFF0000AA, "You must be a medic!");
    else
    {
        SetPlayerHealth(id, 100.0);
        SendClientMessage(id, 0x00FF00AA, "You have been healed");
        SendClientMessage(playerid, 0x00FF00AA, "Player healed");
    }
    return 1;
}
Simply change "Team_Medic" to whatever you have it set to.
Reply
#3

Quote:
Originally Posted by llama

Simply change "Team_Medic" to whatever you have it set to.
Could you show me a example of what you mean?
Reply
#4

It's simply whatever you have the Team_Medic variable set to.

Like for example: TEAM_MEDIC, Team_Medic, Medic, MEDIC, etc.
Reply
#5

Idk i dont get you....
could someone help me put a function to make it allow for the medics team only?
Reply
#6

You use gTeam, yes?

This link should help you: https://sampwiki.blast.hk/wiki/PAWN_tuto...eam_deathmatch
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)