-
Posts
708 -
Joined
-
Last visited
Everything posted by K4stic
-
goog script but you can use and this -- Convert Number function convertNumber ( number ) local formatted = number while true do formatted, k = string.gsub(formatted, "^(-?%d+)(%d%d%d)", '%1,%2') if ( k == 0 ) then break end end return formatted end to know more about the ConvertNumber look this: https://wiki.multitheftauto.com/wiki/ConvertNumber to convert money to see it like: ( your money: 99,899,999) and no 99899999 and add the $ firts then the money Example: $99,899,999
-
Your Welcome!
-
For that you need client side --Client Side function warnDM(weapon, ammo, ammoInClip, hitX, hitY, hitZ, hitElement ) if ( getElementType( hitElement ) == "vehicle" ) then outputChatBox ("WARNING!! Don?t shoot at Vehicles!", 255, 20, 20) end end addEventHandler ( "onClientPlayerWeaponFire", localPlayer, warnDM ) And you used Wrong section for scripting help
-
i just fix youtube tags from LyCry0 to show the map nothing else -.-"
-
TAPL i will PM you my code
-
yes because then i remove the 3d distange and adding just money then it works but then using 3d distange it bugged only to that line
-
ignore it and use xXMADEXx code or my the username,password and IP must be same with your mySQL local function connect( ) connection = dbConnect( "mysql", "host IP", "username", "password", "share=1" ) if connection then outputConsole ( "Server is now connected with the MySQL database!", 1 ) return true else outputConsole ( "Connection with the MySQL database failed!", 1 ) return false end end addEventHandler ( "onResourceStart", resourceRoot, connect )
-
yes is working all only this not working the bug is only on getDistanceBetweenPoints3D and is just output on chatbox the false
-
output me false at chatbox code of cordinates+the previus code local x, y, z = getElementPosition( player ) local x2, y2, z2 = unpackbriefmark ( ) totalDist = getDistanceBetweenPoints3D ( x, y, z, x2, y2, z2 ) outputChatBox ( tostring(totalDist) ) paycheck = math.floor(tonumber(totalDist*100 )) totalPay = givePlayerMoney ( hitElement, (paycheck) )
-
totalDist = getDistanceBetweenPoints3D ( x, y, z, x2, y2, z2 ) paycheck = math.floor(tonumber(totalDist*100 )) totalPay = givePlayerMoney ( hitElement, (paycheck) ) it says me line 2: attempt to perform arithmetic on giobal 'totalDist' (a boolean value)
-
this lag making a Client side you must reduse the timers on Client side to max who you can using Event's if need help just port the code
-
[DM] RetriX ft Napalm ft ~CReative - Skilled Paradise II
K4stic replied to TroyRecordings's topic in Showroom
This is Just awesome Map Bro! Good Job! -
now working just removed this line and working perfect if ( isElement ( thePlayer ) ) and ( isElement ( theVehicle ) ) then and removed thePlayer
-
function VehicleEnter( thePlayer, theVehicle, seat ) local model = getElementModel ( theVehicle ) if ( model == 411 ) or ( model == 480 ) and ( seat == 0 ) then if ( isElement ( thePlayer ) ) and ( isElement ( theVehicle ) ) then setVehicleDamageProof ( theVehicle, true ) end end end addEventHandler ( "onPlayerVehicleEnter", root, VehicleEnter ) no errors just no work
-
realy don't know what to do then one player buy the train and then come and other and buy train he can kill other peds of other players who buy train (all who buy the train can kill the other player peds) -- Client Side local pedCoords = { [1] = {280.59, -139.83, 1004.06,7,1}, [2] = {280.7, -135.64, 1004.06,7,1}, [3] = {284.45, -131.24, 1004.06,7,1}, [4] = {288.15, -134.05, 1004.06,7,1}, [5] = {290.01, -135.76, 1004.06,7,1}, [6] = {285.16, -137.9, 1004.06,7,1}, [7] = {279.2, -139.89, 1004.06,7,1}, [8] = {276.01, -135.35, 1004.06,7,1}, [9] = {278.4, -129.79, 1004.06,7,1}, [10] = {283.1, -130.99, 1004.06,7,1}, [11] = {289.98, -128.18, 1004.06,7,1}, [12] = {295.72, -129.21, 1004.06,7,1} } function startFiringRange() guiSetVisible(guiRangeWindow,false) showCursor(false) if ( getPlayerMoney(localPlayer) >= 250 ) then triggerServerEvent("takePlayerTrainingMoney", localPlayer) if (getElementInterior(localPlayer) == 7) then for i=1,#pedCoords do theTestPeds[i] = createPed(math.random(168,189),pedCoords[i][1],pedCoords[i][2],pedCoords[i][3] +0.5, 269) theTestPedsCount = theTestPedsCount +1 setElementData( theTestPeds[i], "weaponTrainPed", true ) setElementInterior( theTestPeds[i], 7 ) setElementDimension( theTestPeds[i], getElementDimension(localPlayer) ) end addEventHandler( "onClientRender", root, onClientRenderWeaponTraining ) shootingTimer = setTimer ( onWeaponTrainingEnd, 120000, 1, false ) isPlayerDoingTest = true end else exports.SCGhelp:createNewHelpMessage("You don't have enough money for the training!",255,0,0,true) end end addEventHandler("onClientPedWasted", root, function( killer, weapon, bodypart ) if ( getElementData ( source, "weaponTrainPed" ) ) and ( killer == localPlayer ) then theTestPedsCount = theTestPedsCount -1 end end ) addEventHandler("onClientPedDamage", root, function( attacker, weapon, bodypart ) if ( isElement( attacker ) ) then if ( getElementData ( source, "weaponTrainPed" ) ) and ( attacker == localPlayer ) then if not ( ( allowedWeapons[getPedWeapon ( localPlayer )] ) ) then exports.SCGhelp:createNewHelpMessage("You can't use this weapon to train!",255,0,0,true) cancelEvent() return elseif ( playerTestWeapon == nil ) then playerTestWeapon = getPedWeapon ( localPlayer ) return elseif ( playerTestWeapon ~= getPedWeapon ( localPlayer ) ) then exports.SCGhelp:createNewHelpMessage("You need to use the same weapon for the whole training!",255,0,0,true) cancelEvent() return end end end end ) EDIT: Code not full only some parts
-
Perfect map Bro
-
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
-
so make it setAccountData ( getPlayerAccount ( source ), "ownSilenced", true ) ?
-
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 )
