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=510390)
Weapon -
Ananisiki - 30.04.2014
I give player weapon on spawn, when i spec someone and go off spec, i get more ammo each time, how i can solve this
and how i can solve like if player is not registered he wont get weapons,
Re: Weapon -
Eth - 01.05.2014
show me the spec and the spec off command. and show me the if isregistered thing.
Re: Weapon -
Danyal - 01.05.2014
create a variable and check if player returned from spec'ing if yes he should not be given ammo but if no he should be given ammo.
Re: Weapon -
Ananisiki - 01.05.2014
howv
Re: Weapon -
TheSimpleGuy - 01.05.2014
pawn Код:
// add on the top
new spec[MAX_PLAYERS];
pawn Код:
// Add on /spec command
spec[playerid] = 1;
pawn Код:
// Add on OnPlayerSpawn *the top before the Weapon Script*
if(spec[playerid] == 1) return 1;
pawn Код:
spec[playerid] = 0;
Now put on any callback/command/shit this, because this will trigger he/she didn't use /spec anymore.
Re: Weapon -
Konstantinos - 01.05.2014
Just reset the player's weapons first and then give them the weapons you want (both in OnPlayerSpawn callback).
Re: Weapon -
Ananisiki - 01.05.2014
What u mean o.o
Re: Weapon -
Danyal - 01.05.2014
ResetPlayerWeapons(playerid);
Just before GivePlayerWeapon(....
Re: Weapon -
Konstantinos - 01.05.2014
I mean that you can reset the weapons and then give the weapons you want so it won't add the previous ammo.
pawn Код:
public OnPlayerSpawn(playerid)
{
ResetPlayerWeapons(playerid);
GivePlayerWeapon(playerid, ...); // edit the weaponid and ammo
// rest of code..
return 1;
}
In case you use server-side weapons, you should use your custom functions.
Re: Weapon -
Ananisiki - 02.05.2014
thx +rep