Jump to content

sheenidgs

Members
  • Posts

    23
  • Joined

  • Last visited

Details

  • Gang
    Cingka

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

sheenidgs's Achievements

Civilian

Civilian (7/54)

0

Reputation

  1. CLIENT triggerServerEvent ( "kick", resourceRoot, abc ) SERVER function fox ( player ) kickPlayer( player ) end In abc, make sure that's a player who you want to kick OR you can do this solution CLIENT triggerServerEvent ( "kick", targetPlayer ) SERVER function fox () kickPlayer( source ) end targetPlayer = the player that you want kick
  2. Make sure your Apache and MySQL is running. Open your XAMPP Control Panel
  3. Try this CLIENT SCRIPT function bind_c() -- get the veh first local veh = getPedOccupiedVehicle( localPlayer ) if veh then -- if the veh is valid -- you need an argument IF the handled function has some arguments triggerServerEvent ( "create", resourceRoot, veh ) end end SERVER-SIDE weapOff = {} weapOff[422] = {-0.1, -1.9, -0.2, 0, 30, 60} weapOff[470] = {-0.1, 0.1, 1.0, 0, 30, 60} function createVehicleMachinegun (veh) local x,y,z = getElementPosition(veh) local mid = getElementModel(veh) if weapOff[mid] then local weapon = createObject ( 362, x+weapOff[mid][1],y+weapOff[mid][2],z+weapOff[mid][3]) local weapon_base = createObject ( 336, x+weapOff[mid][1],y+weapOff[mid][2],z) attachElements ( weapon_base, veh, weapOff[mid][1], weapOff[mid][2], weapOff[mid][3], 0, 0, 0) attachElements ( weapon, weapon_base, 0, -0.3, 0.9, weapOff[mid][4], weapOff[mid][5], weapOff[mid][6]) setElementData(veh, "weapon", weapon_base) setElementData(veh, "weapon2", weapon) setElementData(veh, "playerOnWeapon", nil) outputChatBox ( "Machinegun attached!" ) end end addEvent( "create", true ) addEventHandler( "create", root, createVehicleMachinegun )
  4. Thanks for your inspiration!!!! I've solve this problem with this way: - create a resource with Meta.xml file only for resource info Meta.xml from resource mysql "Rachmad Setiawan" type="configuration" name="MySQL" version="1.0" description="A MySQL Configuration from A Resource" /> - include this resource (mysql) to a target resource (the resource that you want to use this configuration) Meta.xml "Rachmad Setiawan" type="client-login" name="Login Panel" version="1.0" description="A login panel using MySQL" /> -- Butuh resource lain untuk konfigurasinya, seperti MySQL --> resource="mysql" /> - add resource owner (mysql) to the configuration -- Pengaturan koneksi ke database di MySQL --> "#mysql.host" value="127.0.0.1"> "#mysql.port" value="3306"> "#mysql.user" value="mta-sa"> "#mysql.pass" value="mta"> "#mysql.db" value="mta_sa"> - get the configuration server.lua local sqlHandle = nil local connString = nil local accParse = { "id","admin","level","team","xp","points","skin","kills","deaths","location","money","bank" } -- inisialisasi MySQL local sqlHost = "host=" ..get( "mysql.host" ) or "none" local sqlPort = "port=" ..get( "mysql.port" ) or "none" local sqlUser = get( "mysql.user" ) or "none" local sqlPass = get( "mysql.pass" ) or "none" local sqlDB = "dbname=" ..get( "mysql.db" ) or "none" Thanks for the help
  5. Hi I want ask my problem about settings.xml I have a script like this server.lua local sqlHandle = nil local connString = nil local accParse = { "id","admin","level","team","xp","points","skin","kills","deaths","location","money","bank" } -- inisialisasi MySQL local sqlHost = "host=" ..get( "MySQLHost" ) or "none" local sqlPort = "port=" ..get( "MySQLPort" ) or "none" local sqlUser = get( "MySQLUser" ) or "none" local sqlPass = get( "MySQLPass" ) or "none" local sqlDB = "dbname=" ..get( "MySQLDB" ) or "none" settings.xml "MySQLHost" value="127.0.0.1"> "MySQLPort" value="3306"> "MySQLUser" value="mta-sa"> "MySQLPass" value="mta"> "MySQLDB" value="mta_sa"> In server.lua, I use get function to get the settings value in settings.xml, BUT it doesn't work and I don't know why I've read this wiki -> https://wiki.multitheftauto.com/wiki/Settings_system and it should be work. This is what i've tried: - change "MySQLHost" to "*MySQLHost" <-- it doesn't work - change "MySQLHost" to "*joinpanel.MySQLHost" <-- it works! But that's not my goal. I want make this setting applied to all of the resources i had. It should be works if I'm not input the access modified and resource name This is settings.xml what I mean
  6. Hey, it works! Thanks Btw, could you resolve my another problem ? -> viewtopic.php?f=91&t=64828
  7. Yes. The map file is on the meta.xml "location.map" />
  8. Hi... I have a problem with getElementsByType. local location = getElementsByType ( "carjunk" ) print (#location) And this is my .map file <jobsystem> <carjunk x="1643.1171" y="-1515.9602" z="13.6608" /> <!-- Car junk LS - Dealer --> <carjunk x="2050.0410" y="-2493.8975" z="13.5469" /> <!-- Car junk LS - Airport --> <carjunk x="2449.2085" y="-2717.8171" z="1.2407" /> <!-- Car junk LS - Dock --> <carjunk x="-1936.1998" y="276.2972" z="41.0469" /> <!-- Car junk SF - Dealer --> <carjunk x="-1444.9786" y="-518.4357" z="13.8330" /> <!-- Car junk SF - Airport --> <carjunk x="-1650.2468" y="254.0446" z="-0.4856" /> <!-- Car junk SF - Dock --> <carjunk x="1406.0493" y="970.4077" z="10.8130" /> <!-- Car junk LV - Dealer --> <carjunk x="1370.8197" y="1769.5979" z="10.4103" /> <!-- Car junk LV - Airport --> <carjunk x="1628.2588" y="572.7244" z="-0.4549" /> <!-- Car junk LV - Dock --> </jobsystem> But, the return value is 0. I've already change theType on getElementsByType to jobsystem, but it's keep 0.
  9. I've tried a few methods. First, i tried to change the stats to 5000 because colt_cop's skill level is at 5000. addEventHandler('onPlayerSpawn', root, function() if not setPedStat(source,22,5000) then outputChatBox ( "Failed to set stats number: 22 with value: 5000", player, 255, 0, 0, false ) end end ) But the function return false. Second, i tried to change the flags from colt_cop to colt45. Then, i convert it to hex number with calc and place this code. But, the anim was going to be weird.
  10. It's doesn't work because I've already tried it before.
  11. Hi.... I wanna ask how to make one-handed weapon to two-handed. Btw, I have found something on weapon.dat. Is is possible to set it ? Sorry for my bad English
  12. Oh man... It's my fault. You're right about the meta hehe.... Thanks for help me
  13. Hi... I have a new problem with GUI (before case I've solved my problem) <- skip this This is my full code client.lua GUIEditor = { tab = {}, staticimage = {}, edit = {}, window = {}, tabpanel = {}, button = {}, label = {}, gridlist = {}, memo = {} } weaponShop = { } addEventHandler("onClientResourceStart", resourceRoot, function() local shopElements = getElementsByType ( "weapon" , getResourceRootElement() ) local num = 1 for k,v in ipairs(shopElements) do weaponShop[num] = { } weaponShop[num].ID = getElementData ( v, "id" ) weaponShop[num].Name = getElementData ( v, "name" ) weaponShop[num].Price = getElementData ( v, "price" ) weaponShop[num].WeaponID = getElementData ( v, "weaponid" ) weaponShop[num].Slot = getElementData ( v, "slot" ) weaponShop[num].PerClip = getElementData ( v, "perclip" ) weaponShop[num].PriceClip = getElementData ( v, "priceclip" ) local weapon = tonumber ( weaponShop[num].WeaponID ) weaponShop[num].WeaponRange = getWeaponProperty ( weapon, "pro", "weapon_range" ) weaponShop[num].TargetRange = getWeaponProperty ( weapon, "pro", "target_range" ) weaponShop[num].Damage = getWeaponProperty ( weapon, "pro", "damage" ) weaponShop[num].Accuracy = getWeaponProperty ( weapon, "pro", "accuracy" ) weaponShop[num].FiringSpeed = getWeaponProperty ( weapon, "pro", "firing_speed" ) weaponShop[num].WeaponSlot = getWeaponProperty ( weapon, "pro", "weapon_slot" ) num = num + 1 end GUIEditor.window[1] = guiCreateWindow(377, 185, 667, 313, "Ammu-Nation", false) guiWindowSetSizable(GUIEditor.window[1], false) GUIEditor.tabpanel[1] = guiCreateTabPanel(9, 22, 648, 281, false, GUIEditor.window[1]) GUIEditor.tab[1] = guiCreateTab("Weapon & Ammo", GUIEditor.tabpanel[1]) GUIEditor.gridlist[1] = guiCreateGridList(7, 7, 150, 155, false, GUIEditor.tab[1]) local column = guiGridListAddColumn(GUIEditor.gridlist[1], "Weapon", 0.9) local number = table.maxn ( weaponShop ) local iter = 1 for count = iter, number, 1 do local row = guiGridListAddRow(GUIEditor.gridlist[1]) local getname = tostring ( weaponShop[count].Name ) guiGridListSetItemText(GUIEditor.gridlist[1], row, column, "".. getname .."", false, false) end GUIEditor.staticimage[1] = guiCreateStaticImage(187, 59, 64, 64, "images/UNKNOWN.png", false, GUIEditor.tab[1]) GUIEditor.label[1] = guiCreateLabel(289, 9, 282, 15, "Weapon Name:", false, GUIEditor.tab[1]) GUIEditor.label[2] = guiCreateLabel(309, 24, 282, 15, "Weapon ID:", false, GUIEditor.tab[1]) GUIEditor.label[3] = guiCreateLabel(350, 39, 282, 15, "Slot:", false, GUIEditor.tab[1]) GUIEditor.label[4] = guiCreateLabel(293, 54, 282, 15, "Ammo per Clip:", false, GUIEditor.tab[1]) GUIEditor.label[5] = guiCreateLabel(289, 69, 282, 15, "Weapon Range:", false, GUIEditor.tab[1]) GUIEditor.label[6] = guiCreateLabel(299, 84, 282, 15, "Target Range:", false, GUIEditor.tab[1]) GUIEditor.label[7] = guiCreateLabel(330, 99, 282, 15, "Damage:", false, GUIEditor.tab[1]) GUIEditor.label[8] = guiCreateLabel(325, 114, 282, 15, "Accuracy:", false, GUIEditor.tab[1]) GUIEditor.label[9] = guiCreateLabel(307, 129, 282, 15, "Firing Speed:", false, GUIEditor.tab[1]) GUIEditor.label[10] = guiCreateLabel(349, 144, 282, 15, "Price: $", false, GUIEditor.tab[1]) GUIEditor.button[1] = guiCreateButton(491, 215, 150, 31, "Buy", false, GUIEditor.tab[1]) guiSetFont(GUIEditor.button[1], "default-bold-small") GUIEditor.button[2] = guiCreateButton(7, 215, 150, 31, "Armor: $250", false, GUIEditor.tab[1]) guiSetFont(GUIEditor.button[2], "default-bold-small") GUIEditor.label[11] = guiCreateLabel(311, 159, 282, 15, "Ammo Price: $ per clip", false, GUIEditor.tab[1]) GUIEditor.label[12] = guiCreateLabel(174, 221, 172, 15, "How many clips do you want ?", false, GUIEditor.tab[1]) GUIEditor.edit[1] = guiCreateEdit(349, 215, 60, 27, "", false, GUIEditor.tab[1]) guiEditSetMaxLength(GUIEditor.edit[1], 2) GUIEditor.label[13] = guiCreateLabel(490, 186, 148, 15, "Total: $", false, GUIEditor.tab[1]) GUIEditor.tab[2] = guiCreateTab("About", GUIEditor.tabpanel[1]) GUIEditor.memo[1] = guiCreateMemo(9, 7, 633, 244, "Dibuat oleh: Rachmad Setiawan\nPenggunaan:\n\n- Klik senjata yang ingin dibeli.\n- Masukkan jumlah klip peluru yang ingin dibeli\n- Klik buy untuk membeli\n\nNB:\n* Pastikan jumlah uang mencukupi\n* Klik armor jika ingin membeli armor\n* Anda harus membayar senjatanya kalau sebelumnya tidak mempunyai senjata yang Anda ingin beli", false, GUIEditor.tab[2]) guiMemoSetReadOnly(GUIEditor.memo[1], true) end ) function updateWeaponShop ( row ) local num = row + 1 guiStaticImageLoadImage ( GUIEditor.staticimage[1], "images/" .. tostring ( weaponShop[num].ID ) .. ".png" ) guiSetText ( GUIEditor.label[1], "Weapon Name: " .. tostring ( weaponShop[num].WeaponName ) .. "" ) guiSetText ( GUIEditor.label[2], "Weapon ID: " .. tostring ( weaponShop[num].WeaponID ) .. "" ) guiSetText ( GUIEditor.label[3], "Slot: " .. tostring ( weaponShop[num].Slot ) .. "" ) guiSetText ( GUIEditor.label[4], "Ammo per Clip: " .. tostring ( weaponShop[num].PerClip ) .. "" ) guiSetText ( GUIEditor.label[5], "Weapon Range: " .. tostring ( weaponShop[num].WeaponRange ) .. "" ) guiSetText ( GUIEditor.label[6], "Target Range: " .. tostring ( weaponShop[num].TargetRange ) .. "" ) guiSetText ( GUIEditor.label[7], "Damage: " .. tostring ( weaponShop[num].Damage ) .. "" ) guiSetText ( GUIEditor.label[8], "Accuracy: " .. tostring ( weaponShop[num].Accuracy ) .. "" ) guiSetText ( GUIEditor.label[9], "Firing Speed: " .. tostring ( weaponShop[num].FiringSpeed ) .. "" ) guiSetText ( GUIEditor.label[10], "Price: $" .. tostring ( weaponShop[num].Price ) .. "" ) guiSetText ( GUIEditor.label[11], "Ammo Price: $" .. tostring ( weaponShop[num].PriceClip ) .. " per clip" ) if tonumber ( guiGetText ( GUIEditor.edit[1] ) ) > 0 then local input = tonumber ( guiGetText ( GUIEditor.edit[1] ) ) local getslot = tonumber ( weaponShop[num].WeaponSlot ) if getPedTotalAmmo ( localPlayer, getslot ) > 0 then if getPedWeapon ( localPlayer, getslot) == weaponShop[num].WeaponID then return guiSetText ( GUIEditor.label[13], "Total: $" .. ( tonumber ( weaponShop[num].PriceClip ) * input ) .. "" ) end end guiSetText ( GUIEditor.label[13], "Total: $" .. ( weaponShop[num].Price + ( tonumber ( weaponShop[num].PriceClip ) * input ) ) .. "" ) else guiSetText ( GUIEditor.label[13], "Total: $" ) end end addEventHandler("onClientGUIClick", root, function () if source == GUIEditor.gridlist[1] then local row,column = guiGridListGetSelectedItem ( source ) updateWeaponShop ( row ) end end ) addEventHandler("onClientGUIChanged", root, function () if source == GUIEditor.edit[1] then updateWeaponShop ( row ) end end ) addCommandHandler ( "Control Weapon Panel", function () guiGridListSetSelectedItem ( GUIEditor.gridlist[1], 0, 0 ) guiSetVisible ( GUIEditor.window[1], not guiGetVisible ( GUIEditor.window[1] ) ) showCursor ( guiGetVisible ( GUIEditor.window[1] ) ) guiSetInputMode ( "no_binds_when_editing" ) guiSetText ( GUIEditor.edit[1], "" ) end ) bindKey ( "n", "down", "Control Weapon Panel" ) And this is my error from clientscript.log [2013-04-28 23:17:17] WARNING: weaponshop\client.lua:88: Bad argument @ 'guiStaticImageLoadImage' [Expected gui-element at argument 1, got nil]
  14. I need help for my problem, please.
×
×
  • Create New...