[FilterScript] Armour Update
#1

What this script do:

[ame]http://www.youtube.com/watch?v=H41c86Max0Q[/ame]

Okay! let's do this =) :

In the top of your code paste this:

pawn Код:
#define ARMOUR_INDEX 4 // this is the index of armour

next step: we pasting code to on playerupdate:

pawn Код:
public OnPlayerUpdate(playerid)
{
    new Float:armour[MAX_PLAYERS];
    GetPlayerArmour(playerid, armour[playerid]);
    if( armour[playerid] > 0.0 )
    {
        SetPlayerAttachedObject( playerid, ARMOUR_INDEX, 1242, 1, 0.019999, 0.039999, 0.000000, 2.459999, 89.699989, -3.100000, 1.710000, 2.119999, 1.719999);//áðîíÿ
    }
    else if( armour[playerid] == 0.0 && IsPlayerAttachedObjectSlotUsed(i, ARMOUR_INDEX))
    {
        RemovePlayerAttachedObject(playerid, ARMOUR_INDEX); // armour
    }
    return 1;
}
So this is it, thanks for watching, reading, and using!
and sorry for my bad english!
Reply
#2

great good job
Reply
#3

Very nice, good job.
Reply
#4

well here is the fix code


pawn Код:
public ArmourUpdate()
{
    new Float:armour;//this is our armour value
    for(new i=0; i<=GetMaxPlayers(); i++)//i'm put this code, cause i had bug before, when armour can have only player with id 0!
    {
        GetPlayerArmour(i, armour);//checking hommuch armour player has...
        if( armour > 0.0 )//...if player has more then 0.0 of armour...
        {
            SetPlayerAttachedObject( i, ARMOUR_INDEX, 373, 1, 0.286006, -0.038657, -0.158132, 67.128456, 21.916156, 33.972290, 1.000000, 1.000000, 1.000000 ); // ...armour getting on the players body...
        }
        else if( armour == 0.0 )//...if player do not have armour...
        {
            RemovePlayerAttachedObject(i, ARMOUR_INDEX); // ...armour getting off the players body...
        }
        return 1;//the value what function returning
    }
    return 0;
}
Reply
#5

great job!!!!!fuck, this great!!!!!!!!!!!!!!!!!!!good job!
Reply
#6

Quote:

great job!!!!!fuck, this great!!!!!!!!!!!!!!!!!!!good job!

thanks

Quote:

well here is the fix code

okay, thanks, i see my mistake
Reply
#7

oh that's nice
GJ
Reply
#8

You forgot to forward it, newbies will get confused,
Код:
 forward ArmourUpdate();
Reply
#9

NICE!
I found an armour object, but it was too small :S (the size of the pickup).
Is this an custom object, or an object that was already there and I never found?
Reply
#10

Tested it, Only ID 0 gets the armour.

Edit:
Use this works with whole server.
Код:
forward ArmourUpdate();
public ArmourUpdate()
{
    new Float:armour;//this is our armour value
    for(new i=i;i<MAX_PLAYERS;i++)//
    {
        GetPlayerArmour(i, armour);//checking hommuch armour player has...
        if( armour > 0.0 )//...if player has more then 0.0 of armour...
        {
            SetPlayerAttachedObject( i, ARMOUR_INDEX, 373, 1, 0.286006, -0.034657, -0.158132, 67.128456, 21.916156, 33.972290, 1.000000, 1.000000, 1.000000 ); // ...armour getting on the players body...
        }
        else if( armour == 0.0 )//...if player do not have armour...
        {
            RemovePlayerAttachedObject(i, ARMOUR_INDEX); // ...armour getting off the players body...
        }
        return 1;//the value what function returning
    }
    return 0;
}
Bit slow to load up, but its reliable.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)