Help with a weapon system. +
#1

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?
Reply
#2

Explain yourself please, then you might receive some help.
Reply
#3

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

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

Reply
#5

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


Forum Jump:


Users browsing this thread: 1 Guest(s)