Weapon
#1

Hello im scripting a new dm system "never made"
I have to know how to make when a player types the cmd /gundm the player spawns with a gun .
I have me how to replace that weapon with another weapon .
I have added new maps too with teleport .

*------------------------------------------------*

Quote:
Originally Posted by Phyzic
Посмотреть сообщение
pawn Код:
GivePlayerWeapon(playerid, WEAPON_NAME, Bullets Amount);
Quote:
Originally Posted by Rabea
Посмотреть сообщение
i dont really understand what you mean but anyway, i made a cmd when you type /gundm it will give you m4 with 500 bullets.


Код:
CMD:gundm(playerid, params[])
{
     GivePlayerWeapon(playerid, 31, 500); // this will give you m4 with 500 bullets
     return 1;
}
Quote:
Originally Posted by Phyzic
Посмотреть сообщение
pawn Код:
GivePlayerWeapon(playerid, WEAPON_NAME, Bullets Amount);
Quote:
Originally Posted by Rabea
Посмотреть сообщение
i dont really understand what you mean but anyway, i made a cmd when you type /gundm it will give you m4 with 500 bullets.


Код:
CMD:gundm(playerid, params[])
{
     GivePlayerWeapon(playerid, 31, 500); // this will give you m4 with 500 bullets
     return 1;
}
Quote:
Originally Posted by HazardouS
Посмотреть сообщение
You want the player to get a gun at the next spawn? Do something like this
pawn Код:
new SpawnWithGun[MAX_PLAYERS];
public OnPlayerConnect(playerid)
{
    SpawnWithGun[playerid] = 0;
    return 1;
}
public OnPlayerSpawn(playerid)
{
    if(SpawnWithGun[playerid] != 0) GivePlayerWeapon(playerid, SpawnWithGun[playerid], ammo); // Replace ammo with how many bullets you want the player to have
    return 1;
}
//Within your gundm command, add SpawnWithGun[playerid] = value; //value is the gun id the player will get when he spawns https://sampwiki.blast.hk/wiki/Weapons
THANKS VERY MUCH .
Reply


Messages In This Thread
Weapon - by JeevanJyothish - 23.08.2014, 11:01
Re: Weapon - by JeevanJyothish - 23.08.2014, 11:05
Re: Weapon - by Phyzic - 23.08.2014, 11:07
Re: Weapon - by Rabea - 23.08.2014, 11:07
Re: Weapon - by Tadas - 23.08.2014, 11:08
Re: Weapon - by HazardouS - 23.08.2014, 11:11

Forum Jump:


Users browsing this thread: 1 Guest(s)