Any Ideas?
#1

Hello i have no idea in how to do this but how would i make these weapons have restrictions so that only level 1337

the weapons are (4,9,35-40)
Reply
#2

Just dont give the players these weapons.. or just set a timer ongamemode init, that check all the players after X amount of time and set it as repeating. If the player has the weapon, remove it.
Reply
#3

Can you please show an example?
Reply
#4

Under OnGameModeInit:
pawn Код:
SetTimer("CheckWeapons", 1000*5, true); // Runs the timer every 5 seconds
The timer:
pawn Код:
forward CheckWeapons();
public CheckWeapons()
{
    new weapons[13][2]; // The array where to store the weapon data
   
    for(new p = 0; p < MAX_PLAYERS; p++) // We loop through all the players
    {
        for (new i = 0; i < 13; i++) // SAMP has 13 weapon slots, so we loop through every one
        {
            GetPlayerWeaponData(p, i, weapons[i][0], weapons[i][1]); // This gets the weapon data from the weapon slot
            if(weapons[i][0] == 4 || weapons[i][0] == 9 || weapons[i][0] == 35 || weapons[i][0] == 36 || weapons[i][0] == 37 || weapons[i][0] == 38 || weapons[i][0] == 39 || weapons[i][0] == 40) // The weaponid will be stored in weapons[i][0], so we check if it matches our weapon ID's
            {
                GivePlayerWeapon(p, weapons[i][0], 0); // Removes the player's weapon
            }
        }
    }
There may be a more efficient way, because running loops in a timer isn't the best way I think, but it should work!
Reply
#5

Thank you very much +1 rep.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)