SA-MP Forums Archive
How To Make Weapon Sets Urgent Help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: How To Make Weapon Sets Urgent Help (/showthread.php?tid=316288)



How To Make Weapon Sets Urgent Help - RockStar™ - 06.02.2012

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


Re: How To Make Weapon Sets Urgent Help - Cameltoe - 06.02.2012

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;
}



Re: How To Make Weapon Sets Urgent Help - RockStar™ - 06.02.2012

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


Re: How To Make Weapon Sets Urgent Help - Cameltoe - 06.02.2012

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;
}



Re: How To Make Weapon Sets Urgent Help - RockStar™ - 06.02.2012

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+