How to add this.
#1

pawn Код:
//OnPlayerUpdate
    static
        Float: cHealth,
        Float: pHealth[MAX_PLAYERS];
    GetPlayerHealth(playerid, cHealth);
    if(cHealth != pHealth[playerid]) {
        OnPlayerHealthChange(playerid, pHealth[playerid], cHealth);
        pHealth[playerid] = cHealth;
    }
pawn Код:
OnPlayerHealthChange(playerid, Float: oldhealth, Float: newhealth) {
    new tmp[128];
    GetPlayerName(playerid, tmp, MAX_PLAYER_NAME);
    format(tmp, sizeof tmp, "%s changed his health from %.0f to %.0f", oldhealth, newhealth);
    SendClientMessageToAll(BLUE, tmp);
}
How to add that above to this below:

pawn Код:
CMD:armourme(playerid, params[])
{
    if(dini_Int(PFile(playerid),"VipMember")<3)return SendClientMessage(playerid, red, "You must be Premium member to use this command");
    {
    SendClientMessage(playerid, red, "You must be Premium member to %.0f to %.0f", oldhealth, newhealth);
    SetPlayerArmour(playerid, 99);
    }
    return 1;
}
Reply
#2

I don't understand what do you want.
Reply
#3

Quote:
Originally Posted by Darnell
Посмотреть сообщение
I don't understand what do you want.
Do not post leech.

Ill explain it in a way you might be able to understand. How.Do.You.Add.That.Script.In.His.Script.In.The.Ri ght.Places.So.That.He.Will.Not. Receive.Errors. All set?
Reply
#4

Quote:
Originally Posted by Shockey HD
Посмотреть сообщение
Do not post leech.

Ill explain it in a way you might be able to understand. How.Do.You.Add.That.Script.In.His.Script.In.The.Ri ght.Places.So.That.He.Will.Not. Receive.Errors. All set?
It's funny how you say to me not to post leech while you are doing it.
OT :
pawn Код:
public OnPlayerUpdate(playerid)
{
    static
        Float: cHealth,
        Float: pHealth[MAX_PLAYERS];
    GetPlayerHealth(playerid, cHealth);
    if(cHealth != pHealth[playerid]) {
        OnPlayerHealthChange(playerid, pHealth[playerid], cHealth);
        pHealth[playerid] = cHealth;
    return 1;
}
Anywhere at your script :
pawn Код:
OnPlayerHealthChange(playerid, Float: oldhealth, Float: newhealth) {
    new tmp[128];
    GetPlayerName(playerid, tmp, MAX_PLAYER_NAME);
    format(tmp, sizeof tmp, "%s changed his health from %.0f to %.0f", oldhealth, newhealth);
    SendClientMessageToAll(BLUE, tmp);
}
At the bottom of your script.
pawn Код:
CMD:armourme(playerid, params[])
{
    if(dini_Int(PFile(playerid),"VipMember")<3)return SendClientMessage(playerid, red, "You must be Premium member to use this command");
    {
    SendClientMessage(playerid, red, "You must be Premium member to %.0f to %.0f", oldhealth, newhealth);
    SetPlayerArmour(playerid, 99);
    }
    return 1;
}
Reply
#5

Quote:
Originally Posted by Alex_Obando
Посмотреть сообщение
pawn Код:
//OnPlayerUpdate
    static
        Float: cHealth,
        Float: pHealth[MAX_PLAYERS];
    GetPlayerHealth(playerid, cHealth);
    if(cHealth != pHealth[playerid]) {
        OnPlayerHealthChange(playerid, pHealth[playerid], cHealth);
        pHealth[playerid] = cHealth;
    }
pawn Код:
OnPlayerHealthChange(playerid, Float: oldhealth, Float: newhealth) {
    new tmp[128];
    GetPlayerName(playerid, tmp, MAX_PLAYER_NAME);
    format(tmp, sizeof tmp, "%s changed his health from %.0f to %.0f", oldhealth, newhealth);
    SendClientMessageToAll(BLUE, tmp);
}
How to add that above to this below:

pawn Код:
CMD:armourme(playerid, params[])
{
    if(dini_Int(PFile(playerid),"VipMember")<3)return SendClientMessage(playerid, red, "You must be Premium member to use this command");
    {
    SendClientMessage(playerid, red, "You must be Premium member to %.0f to %.0f", oldhealth, newhealth);
    SetPlayerArmour(playerid, 99);
    }
    return 1;
}
Quote:
Originally Posted by Darnell
Посмотреть сообщение
It's funny how you say to me not to post leech while you are doing it.
OT :
pawn Код:
public OnPlayerUpdate(playerid)
{
    static
        Float: cHealth,
        Float: pHealth[MAX_PLAYERS];
    GetPlayerHealth(playerid, cHealth);
    if(cHealth != pHealth[playerid]) {
        OnPlayerHealthChange(playerid, pHealth[playerid], cHealth);
        pHealth[playerid] = cHealth;
    return 1;
}
Anywhere at your script :
pawn Код:
OnPlayerHealthChange(playerid, Float: oldhealth, Float: newhealth) {
    new tmp[128];
    GetPlayerName(playerid, tmp, MAX_PLAYER_NAME);
    format(tmp, sizeof tmp, "%s changed his health from %.0f to %.0f", oldhealth, newhealth);
    SendClientMessageToAll(BLUE, tmp);
}
At the bottom of your script.
pawn Код:
CMD:armourme(playerid, params[])
{
    if(dini_Int(PFile(playerid),"VipMember")<3)return SendClientMessage(playerid, red, "You must be Premium member to use this command");
    {
    SendClientMessage(playerid, red, "You must be Premium member to %.0f to %.0f", oldhealth, newhealth);
    SetPlayerArmour(playerid, 99);
    }
    return 1;
}
How to add THESE Two:
pawn Код:
//OnPlayerUpdate
    static
        Float: cHealth,
        Float: pHealth[MAX_PLAYERS];
    GetPlayerHealth(playerid, cHealth);
    if(cHealth != pHealth[playerid]) {
        OnPlayerHealthChange(playerid, pHealth[playerid], cHealth);
        pHealth[playerid] = cHealth;
    }
pawn Код:
OnPlayerHealthChange(playerid, Float: oldhealth, Float: newhealth) {
    new tmp[128];
    GetPlayerName(playerid, tmp, MAX_PLAYER_NAME);
    format(tmp, sizeof tmp, "%s changed his health from %.0f to %.0f", oldhealth, newhealth);
    SendClientMessageToAll(BLUE, tmp);
}
To this command:

Using that:
%.0f to %.0f

You changed your armour from %.0f to %.0f

pawn Код:
CMD:armourme(playerid, params[])
{
    if(dini_Int(PFile(playerid),"VipMember")<3)return SendClientMessage(playerid, red, "You must be Premium member to use this command");
    {
    SendClientMessage(playerid, red, "You must be Premium member to %.0f to %.0f", oldhealth, newhealth);
    SetPlayerArmour(playerid, 99);
    }
    return 1;
}
Reply
#6

Change any variables with ' Health ' to ' Armour '.
Ex. :
pawn Код:
OnPlayerHealthChange(playerid, pHealth[playerid], cHealth);
To
pawn Код:
OnPlayerArmourChange(playerid, pArmour[playerid], cArmour);
Reply
#7

You need to use the format function for those messages.

Example:

pawn Код:
new szString[128];
format(szString, sizeof(szString), "Welcome to my server %s. Your IP address is %s.", GetName(playerid), getPlayerIP(playerid));
SendClientMessage(playerid, COLOR, szString);
Reply
#8

@Darnell, im not post leeching. im stating the truth.

For an example. Here are some of your post.

Quote:

Bots....

Quote:

OHHH YEAH.

Quote:

dini.

Quote:

He follow me ?
What does that even mean...

Half of your post mean no sense. I suggest do not post on something if you clearly do not know the answer. Re read somebody's post. And get some scripting skill.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)