Creating a gungame system with score!
#1

Hi there! I'm currently trying to create a gun game, developed using samp's LVDM gamemode.

What I need help with is how to set up the if's and else's when it comes to giving weapons..

If your familiar with "gun games", then what I want is to basically tell the script that when a player gets 1 score after a kill, he'll get a new weapon.

So basically I was going in the direction where the script would contain:
pawn Code:
if GetPlayerScore = 1
{
giveplayerweapon....

else if
getplayerscore = 2
giveplayerweapon...

Do you get what I mean?
If you can assist me with this for free, I would be much obliged...

I'm looking forward to hearing from you!

Sincerely, Facepunch
Reply
#2

pawn Code:
public OnPlayerDeath(playerid, killerid, reason)
{
    if(killerid != INVALID_PLAYER_ID)
    {
        new score = GetPlayerScore(killerid);
        SetPlayerScore(killerid, score + 1);
        if(score == 5)
        {
            GivePlayerWeapon(killerid, WeaponID, Ammo);
        }
        else if(score == 10)
        {
            GivePlayerWeapon(killerid, WeaponID, Ammo);
        }
        else if(score == 15)
        {
            GivePlayerWeapon(killerid, WeaponID, Ammo);
        }
        // etc...
    }
    return 1;
}
https://sampwiki.blast.hk/wiki/Weapons
All you have to do is, replace WeaponID with the weapons you want to give players, and Ammo with the amount of ammo you want to give them.
Reply
#3

You mean change player's weapon after each kill?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)