Jump to content

Question

Posted

deci am reusit sa fac comanda /heal care iti da viata 100

am incercat sa fac un fel de "read cmd" pt admin dar nu am reusit

adica vreau sa apara adminilor level 1+ ceva gen "Admin Logs: %s has bought a health refill." atunci cand playerii cumpara viata

3 answers to this question

Recommended Posts

Posted
if (strcmp("/heal", cmdtext, true, 10) == 0)
    {
        if(GetPlayerMoney(playerid) < 1000) return SendClientMessage(playerid, COLOR_ORANGE, "You don't have enough money to heal yourself.");
        GivePlayerMoney(playerid, -1000);
        SetPlayerHealth(playerid, 100);
        SendClientMessage(playerid, GREEN, "You have refilled your health but lost 1000.");
        return true;
    }

Posted

if (strcmp("/heal", cmdtext, true, 10) == 0)
    {
        if(GetPlayerMoney(playerid) < 1000) return SendClientMessage(playerid, COLOR_ORANGE, "You don't have enough money to heal yourself.");
        GivePlayerMoney(playerid, -1000);
        SetPlayerHealth(playerid, 100);
        SendClientMessage(playerid, GREEN, "You have refilled your health but lost 1000.");
        return true;
    }

[pawn]if (strcmp("/heal", cmdtext, true, 10) == 0)

{

if(GetPlayerMoney(playerid) < 1000) return SendClientMessage(playerid, COLOR_ORANGE, "You don't have enough money to heal yourself.");

new sendername[MAX_PLAYER_NAME+2],string[128];

GetPlayerName(playerid,sendername,sizeof(sendername));

GivePlayerMoney(playerid, -1000);

SetPlayerHealth(playerid, 100);

SendClientMessage(playerid, GREEN, "You have refilled your health but lost 1000.");

format(string,sizeof(string),"AdmWarn:{FFFFFF} Player %s a folosit comanda /heal.",sendername);

ABroadCast(COLOR_RED,string,1);

return true;

}

public ABroadCast(color,const string1[],level)

{

foreach(Player,i)

{

if (PlayerData[pAdmin] >= level) // In loc de PlayerData, scrii PlayerInfo sau ce ai tu in gm.

{

    SendClientMessage(i, color, string1);

printf("%s", string1);

}

}

return 1;

}[/pawn]

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.