Spawn with weapons code - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Spawn with weapons code (
/showthread.php?tid=145534)
Spawn with weapons code -
IcyBlight - 02.05.2010
pawn Код:
public OnPlayerSpawn(playerid)
{
new file[128];
new spawnname[MAX_PLAYER_NAME];
GetPlayerName(playerid, spawnname, sizeof(spawnname));
format(file,sizeof(file),"%s.ini",spawnname);
SetPlayerSkin(playerid, PlayerInfo[playerid][Skin]);
TextDrawShowForPlayer(playerid, Textdraw0);
new AmmoPrimary;
new primwep;
primwep = PlayerInfo[playerid][WepPrim];
if(primwep == 32 || primwep == 31 || primwep == 30 || primwep == 29 || primwep == 28) // If AK, MP5, M4, Mac10, Tec9
{
AmmoPrimary = PlayerInfo[playerid][AmmoPrim];
GivePlayerWeapon(playerid, PlayerInfo[playerid][WepPrim], AmmoPrimary);
}
else if(primwep == 35 || primwep == 36) // If RPG, HS RPG
{
AmmoPrimary = PlayerInfo[playerid][AmmoHeavy];
GivePlayerWeapon(playerid, PlayerInfo[playerid][WepPrim], AmmoPrimary);
}
else
{
AmmoPrimary = PlayerInfo[playerid][AmmoRifle];
GivePlayerWeapon(playerid, PlayerInfo[playerid][WepPrim], AmmoPrimary);
}
GivePlayerWeapon(playerid, PlayerInfo[playerid][WepMelee], 0);
GivePlayerWeapon(playerid, PlayerInfo[playerid][WepSec], PlayerInfo[playerid][AmmoSec]);
GivePlayerWeapon(playerid, PlayerInfo[playerid][WepMisc], PlayerInfo[playerid][AmmoMisc]);
if(PlayerInfo[playerid][Camera] == 1 && PlayerInfo[playerid][WepMisc] == 0)
{
GivePlayerWeapon(playerid, 43, 250);
}
SetPlayerArmedWeapon(playerid, 0);
I, for some reason, only get the Melee weapon when I spawn.
Someone explain why my damned code doesn't work please
Think I fixed it, never mind, sorry.
Re: Spawn with weapons code -
ShockDM - 17.07.2010
How did you fix it? i got that problem too!
i making a zombie server and i can't spawn with weapons or i can't spawn NPC
Re: Spawn with weapons code -
[NTX]MikeQ - 17.07.2010
Adding weaps for player on spawn is easy thats what i thought maybe you mean like save the weaps