How To Make Weapon Sets Urgent Help
#1

Hello there Guys I Need To Know That how to make weaponsets

LIke if a player Is 5 hours online And hy types /weaponset He can choose the Classic Weapon Set
And if the Other Person Who is not Online For 5 hours Click it it hsould say Spend 5 hours on this server in order to gain Classic Weapon set
Reply
#2

pawn Код:
new PlayerPlayed[MAX_PLAYERS] = 0;

forward UpdatePlayedTime(playerid);

public UpdatePlayedTime(playerid)
{
    PlayerPlayed[playerid] = PlayerPlayed[playerid] + 1;
}

public OnPlayerConnect(playerid)
{
    SetTimerEx("UpdatePlayedTime", 60 * 1000, true, "i", playerid);
    return 1;
}

command(weaponset, playerid, params[])
{
    if( ( PlayerPlayed[playerid] / 60  ) >= 5)
    {
        // Player has played 5 hours or more...
    }
    return 1;
}
Reply
#3

Quote:
Originally Posted by Cameltoe
Посмотреть сообщение
pawn Код:
new PlayerPlayed[MAX_PLAYERS] = 0;

forward UpdatePlayedTime(playerid);

public UpdatePlayedTime(playerid)
{
    PlayerPlayed[playerid] = PlayerPlayed[playerid] + 1;
}

public OnPlayerConnect(playerid)
{
    SetTimerEx("UpdatePlayedTime", 60 * 1000, true, "i", playerid);
    return 1;
}

command(weaponset, playerid, params[])
{
    if( ( PlayerPlayed[playerid] / 60  ) > 5)
    {
        // Player has played 5 hours or more...
    }
    return 1;
}
Cannot Understand It DUde
Where TO Add Weapons In Here o.O
Reply
#4

pawn Код:
if( ( PlayerPlayed[playerid] / 60  ) >= 5)
    {
        // Add GiveplayerWeapon here
    }
Also if you wish to add more you would have to modify it slightly.
pawn Код:
new PlayerPlayed[MAX_PLAYERS] = 0;

forward UpdatePlayedTime(playerid);

public UpdatePlayedTime(playerid)
{
    PlayerPlayed[playerid] = PlayerPlayed[playerid] + 1;
}

public OnPlayerConnect(playerid)
{
    SetTimerEx("UpdatePlayedTime", 60 * 1000, true, "i", playerid);
    return 1;
}

command(weaponset, playerid, params[])
{
    switch(( PlayerPlayed[playerid] / 60  ))
    {
        case 5 ... 10:
        {
              // Player hs played between 5 and 10 hours.
              // GiveplayerWeapon here
        }
        case 11 ... 20:
        {
              // Player hs played between 11 and 20 hours.
              // GiveplayerWeapon here
        }
    }

    return 1;
}
Reply
#5

Quote:
Originally Posted by Cameltoe
Посмотреть сообщение
pawn Код:
if( ( PlayerPlayed[playerid] / 60  ) >= 5)
    {
        // Add GiveplayerWeapon here
    }
Also if you wish to add more you would have to modify it slightly.
pawn Код:
new PlayerPlayed[MAX_PLAYERS] = 0;

forward UpdatePlayedTime(playerid);

public UpdatePlayedTime(playerid)
{
    PlayerPlayed[playerid] = PlayerPlayed[playerid] + 1;
}

public OnPlayerConnect(playerid)
{
    SetTimerEx("UpdatePlayedTime", 60 * 1000, true, "i", playerid);
    return 1;
}

command(weaponset, playerid, params[])
{
    switch(( PlayerPlayed[playerid] / 60  ))
    {
        case 5 ... 10:
        {
              // Player hs played between 5 and 10 hours.
              // GiveplayerWeapon here
        }
        case 11 ... 20:
        {
              // Player hs played between 11 and 20 hours.
              // GiveplayerWeapon here
        }
    }

    return 1;
}
Ok Dude Thnq Very much rep1+
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)