SA-MP Forums Archive
Help with a weapon system. + - 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: Help with a weapon system. + (/showthread.php?tid=309490)



Help with a weapon system. + - legho - 07.01.2012

Im trying to create a weapon system for example

Deagle = PlayerInfo[playerid][pLevel] >=1;
SMG = PlayerInfo[playerid][pLevel] >=2;

example but i dont have a clue how to go about it can anyone help?


Re: Help with a weapon system. + - Abreezy - 07.01.2012

Explain yourself please, then you might receive some help.


Re: Help with a weapon system. + - legho - 08.01.2012

So you need to be a certain level to have a weaopon :/


Re: Help with a weapon system. + - Mrki_Drakula - 08.01.2012

Use
PHP код:
if(PlayerInfo[playerid][pLevel] >=1)
{
//Blabla GivePlayerWeapon bla bla deagle...
}
else
{
//SendClientmessage bla bla you cant buy a deagle...




Re: Help with a weapon system. + - [ABK]Antonio - 08.01.2012

Are they buying a weapon or is it when they spawn or what?

pawn Код:
public OnPlayerSpawn(playerid)
{
    if(PlayerInfo[playerid][pLevel] >=1)
    {
        GivePlayerWeapon(playerid, 24, 120); //playerid, weaponid, ammo amount
    }
}
You could also do...
pawn Код:
public OnPlayerSpawn(playerid)
{
    switch(PlayerInfo[playerid][pLevel])
    {
        case 1: GivePlayerWeapon(playerid, 24, 120); //playerid, weaponid, ammo amount
        case 2: //Level two
        {
                GivePlayerWeapon(playerid, 24, 120);
                GivePlayerWeapon(playerid, 29, 150);
        }
        case 3: //and so on
    }
}