Re: Server Sided Wepons -
Snipa - 10.04.2012
Sure
Re: Server Sided Wepons -
nickdodd25 - 21.04.2012
Ok question/problem. One bug i found with this is when you give a player a weapon and then the player uses all the ammo up the weapon dissapers from the player, the player can now spawn that weopon from then on or untill the player weapons get reset. I imaging there is a way to get players weapon ammo and if its 0 set the variable to false? It something i was thinking about when i was going through your Tutorial and once i got it to work i tryed it with a parachute pickup and then a weapon command with 10 ammo and para and the weapon i could hack the weapon and even use it the old way like GivePlayerWeapon(playerid,weaponid,ammo); untill the player weapons got reset.
Re: Server Sided Wepons -
Passout - 09.07.2013
perfect,Works like a charm if you get it installed right...(I'm using this!!!!!!!!)
Re: Server Sided Wepons -
Konstantinos - 09.07.2013
You're correct on that. If someone runs out of ammo, the variable is still on true so he can spawn with cheats the same weapon.
I'd recommend to reset the variable to false.
pawn Код:
// Loop through weapons - an example
if( GetPlayerWeaponState( playerid ) == WEAPONSTATE_NO_BULLETS )
{
// Reset the variable to false
}
Long time ago, I made the same server-side weapons and it works perfect. It notices the admins whoever uses a weapons that is not register to the mode.
Re: Server Sided Wepons -
iNoBoDy - 09.07.2013
really helped....
Nice work mate..
Re: Server Sided Wepons -
Snipa - 28.07.2014
Quote:
Originally Posted by Konstantinos
You're correct on that. If someone runs out of ammo, the variable is still on true so he can spawn with cheats the same weapon.
I'd recommend to reset the variable to false.
pawn Код:
// Loop through weapons - an example if( GetPlayerWeaponState( playerid ) == WEAPONSTATE_NO_BULLETS ) { // Reset the variable to false }
Long time ago, I made the same server-side weapons and it works perfect. It notices the admins whoever uses a weapons that is not register to the mode.
|
If you hold down aim and fire, some weapons will stay in your hands, even when they've run out of ammo.
That'd cause some false bans

-----
Also, updated.
Re: Server Sided Wepons -
billy123321 - 27.08.2014
Beautiful, very helpful thank you so much.
Re: Server Sided Wepons -
Snipa - 02.08.2015
Quote:
Originally Posted by billy123321
Beautiful, very helpful thank you so much.
|
Ayy lmao
Re: Server Sided Wepons -
Cypress - 02.08.2015
Quote:
Originally Posted by Snipa
If you hold down aim and fire, some weapons will stay in your hands, even when they've run out of ammo.
That'd cause some false bans 
-----
Also, updated.
|
Actually if you use WEPONSTATE_LAST_BULLET and then check for ammo it won't be false bans no more.
Also you could put all that code under OnPlayerKeyStateChange which would be more logical instead of looping thru all players checking for false weapons.
Re: Server Sided Wepons -
MBilal - 02.08.2015
I tried this under onplayerkeystate not working.
Код:
if(newkeys & KEY_FIRE)
{
new weaponid = GetPlayerWeapon(playerid);
if( GetPlayerWeaponState(weaponid) == WEAPONSTATE_LAST_BULLET )
{
SSWeapon[playerid][weaponid] = false;
// SendClientMessage(playerid, 0xFF0000FF, "Weapon Empty Reseted-");
return 1;
}
}
Re: Server Sided Wepons -
xVIP3Rx - 02.08.2015
Quote:
Originally Posted by MBilal
I tried this under onplayerkeystate not working.
Код:
if(newkeys & KEY_FIRE)
{
new weaponid = GetPlayerWeapon(playerid);
if( GetPlayerWeaponState(weaponid) == WEAPONSTATE_LAST_BULLET )
{
SSWeapon[playerid][weaponid] = false;
// SendClientMessage(playerid, 0xFF0000FF, "Weapon Empty Reseted-");
return 1;
}
}
|
"GetPlayerWeaponState(playerid)" not "GetPlayerWeaponState(weaponid)"
Re: Server Sided Wepons -
Jay_ - 02.08.2015
Before you can even consider implementing a server-side weapon system, you need to compensate for weapons obtained from client-side events:
- Ammunation
- Certain vehicles - golf cart giving you a golf club for example
- Pickups
- Weapons from AddPlayerClass
- Any others
EDIT: Just seen the date of the OP
Re: Server Sided Wepons -
Abagail - 02.08.2015
I honestly never knew a golf cart gave a club but he did mention it at the bottom of the post,
Quote:
Originally Posted by Original Post
Oh, almost forgot! Be sure to give a parachute on spawn or script a workaround. Also for police cars and the caddy.
|
Re: Server Sided Wepons -
Calgon - 02.08.2015
Quote:
Originally Posted by Abagail
Golf carts give you a golf club? Are you sure?
|
they used to