How to make spawning with armour ?
#1

Hello.How to do this ?When player join to the server and he spawn, he get 100 armour ?
Reply
#2

You want to give them armour only the first time they spawn after connect? Or every time they spawn?

pawn Код:
public OnPlayerSpawn(playerid)
{
    SetPlayerArmour(playerid, 100.0);
    return 1;
}
That will give them armour every time they spawn

pawn Код:
new bool: hadArmour[MAX_PLAYERS] = {false, ...};

public OnPlayerSpawn(playerid)
{
    if(hadArmour{playerid} == false)
    {
        SetPlayerArmour(playerid, 100.0);
        hadArmour{playerid} = true;
    }
    return 1;
That will only give them armour the first time they spawn.
Reply
#3

I believe {playerid} should be if it was declared:
pawn Код:
new bool: hadArmour[MAX_PLAYERS char];
Reply
#4

I want to give armour when they spawn.Where i must put the code ?(that is for police class for my server)
Reply
#5

This will give amrour everytime a cop spawns.
pawn Код:
public OnPlayerSpawn(playerid)
{
    if(gTeam[playerid] == POLICE_CLASS) SetPlayerArmour(playerid, 100.0);
    // Change the variable and the police's number to yours
    return 1;
}
Reply
#6

Just simply do:
pawn Код:
public OnPlayerSpawn(playerid)
{
    SetPlayerArmour(playerid, 100.0); //sets the armour of the player to 100
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)