Weapon - 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: Weapon (
/showthread.php?tid=533205)
Weapon -
JeevanJyothish - 23.08.2014
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 .
Re: Weapon -
JeevanJyothish - 23.08.2014
Anyone?
Re: Weapon -
Phyzic - 23.08.2014
pawn Код:
GivePlayerWeapon(playerid, WEAPON_NAME, Bullets Amount);
Re: Weapon -
Rabea - 23.08.2014
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;
}
Re: Weapon -
Tadas - 23.08.2014
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
Re: Weapon -
HazardouS - 23.08.2014
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