K4stic Posted April 2, 2013 Share Posted April 2, 2013 Problem; the i buy the weapon it's ok but after buy weapon and buy the ammo it's say me "First you need to have an Silenced" pls Help me -- Server side -- Buy the weapon addEvent ("buySilenced", true) addEventHandler ("buySilenced", getRootElement(), function ( id, cost, munic ) if (getPlayerMoney ( source ) >= tonumber( cost ) ) then outputChatBox ("YOU HAVE BUY Silenced", source, 0, 255, 0, false) takePlayerMoney ( source, tonumber( cost ) ) giveWeapon( source, tonumber( id ), tonumber( munic ) ) setAccountData ( getPlayerAccount ( source ), "ownSilenced" ) else outputChatBox ("Your money not enough to buy this Weapon", source, 255, 0, 0, false) end end ) -- Buy the ammo for weapon addEvent ("buyAmmoSilenced", true) addEventHandler ("buyAmmoSilenced", getRootElement(), function ( id, cost, munic ) if (getPlayerMoney ( source ) >= tonumber( cost ) ) and getAccountData ( getPlayerAccount ( source ), "ownSilenced" ) then outputChatBox ("You bought Silenced ammo", source, 0, 255, 0, false) takePlayerMoney (source, tonumber ( cost ) ) giveWeaponAmmo(source,tonumber( id ), tonumber( munic ) ) elseif (getPlayerMoney (source) >= tonumber(cost)) and ( not getAccountData ( getPlayerAccount ( source ), "ownSilenced" ) ) then outputChatBox ("First you need to have an Silenced", source, 255, 0, 0, false) elseif (getPlayerMoney (source) < tonumber(cost)) and getAccountData ( getPlayerAccount ( source ), "ownSilenced" ) then outputChatBox ("Your money not enough to buy this item", source, 255, 0, 0, false) else outputChatBox ("YOU NEED FIRST BUY Silenced GUN THEN AMMO FOR Silenced", source, 255, 0, 0, false) end end ) Link to comment
TAPL Posted April 2, 2013 Share Posted April 2, 2013 bool setAccountData ( account theAccount, string key, string value ) Link to comment
TAPL Posted April 2, 2013 Share Posted April 2, 2013 so what wrong i do? setAccountData ( getPlayerAccount ( source ), "ownSilenced" ) bool setAccountData ( account theAccount, string key, string value ) You can see what is wrong? This function require 3 argument, but you have only two. Link to comment
K4stic Posted April 2, 2013 Author Share Posted April 2, 2013 so make it setAccountData ( getPlayerAccount ( source ), "ownSilenced", true ) ? Link to comment
K4stic Posted April 2, 2013 Author Share Posted April 2, 2013 (edited) i make this for buy weapon setAccountData ( getPlayerAccount ( source ), "ownSilenced", "true" ) and use this at buy ammo getAccountData ( getPlayerAccount( source ), "ownSilenced" ) == "true" So Big Thx you TAPL Edited April 2, 2013 by Guest Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now