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

Anyone?
Reply
#3

pawn Код:
GivePlayerWeapon(playerid, WEAPON_NAME, Bullets Amount);
Reply
#4

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;
}
Reply
#5

pawn Код:
CMD:gundm(playerid, parmas[]) {

SetPlayerPos(playerid, x, y,z); //Teleports player to position
GivePlayerWeapon(playerid, 26, 64); //Give player sawn-off shotgun with 64 ammo
SendClientMessage(playerid, COLOR, "Welcome to *Server Name* DM Zone!"); // Sends player welcome message
SetPlayerHealth(playerid, 100.0); //Sets player health to 100%
SetPlayerArmour(playerid, 100.0); //Hive player a armour

}
You can find all weapon's id there:
https://sampwiki.blast.hk/wiki/Weapons
Reply
#6

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)