Jessie Posted February 29, 2012 Share Posted February 29, 2012 Hello, im searching for a script that makes the vehiclechange random every 1 minute. do you have it? do you know anyone have it? Please contact me. Skype: Jessiezwagerman or Pm.. greetz Link to comment
Castillo Posted February 29, 2012 Share Posted February 29, 2012 You want to change the race vehicle change pickups to random? Link to comment
Jessie Posted February 29, 2012 Author Share Posted February 29, 2012 You want to change the race vehicle change pickups to random? No, i mean when you have infernus pickup, 1 minute after u picked it up, the pickup became a sandking. like that. thx for ur fast respond Link to comment
Castillo Posted February 29, 2012 Share Posted February 29, 2012 Ok, I've managed to change the pickup vehicle model and the text over it. -- add this to: race_client.lua: addEvent("changePickupText",true) addEventHandler("changePickupText",root, function (ID, newModel) for index, pickup in pairs(g_Pickups) do if (pickup.type == "vehiclechange" and pickup.id == ID) then pickup.vehicle = newModel pickup.label:text(getVehicleNameFromModel(newModel)) end end end ) -- edit this in race_server.lua: carIDS = { 602, 545, 496, 517, 401, 410, 518, 600, 527, 436, 589, 580, 419, 439, 533, 549, 526, 491, 474, 445, 467, 604, 426, 507, 547, 585, 405, 587, 409, 466, 550, 492, 566, 546, 540, 551, 421, 516, 529, 485, 552, 431, 438, 437, 574, 420, 525, 408, 416, 596, 433, 597, 427, 599, 490, 432, 528, 601, 407, 428, 544, 470, 598, 499, 588, 609, 403, 498, 514, 524, 423, 532, 414, 578, 443, 486, 515, 531, 456, 455, 459, 543, 422, 583, 482, 478, 605, 554, 530, 418, 572, 582, 413, 440, 536, 575, 534, 567, 535, 576, 412, 402, 542, 603, 475, 441, 564, 568, 424, 504, 495, 457, 483, 508, 71, 500, 429, 411, 541, 559, 415, 61, 480, 560, 562, 506, 565, 451, 434, 558, 494, 555, 502, 477, 503, 579, 400, 404, 489, 505, 479, 442, 458, 594 } addEvent('onPlayerPickUpRacePickup') addEvent('onPlayerPickUpRacePickupInternal', true) addEventHandler('onPlayerPickUpRacePickupInternal', g_Root, function(pickupID, respawntime) if checkClient( false, source, 'onPlayerPickUpRacePickupInternal' ) then return end local pickup = g_Pickups[table.find(g_Pickups, 'id', pickupID)] local vehicle = g_Vehicles[source] if not pickup or not vehicle then return end if respawntime and tonumber(respawntime) >= 50 then table.insert(unloadedPickups, pickupID) clientCall(g_Root, 'unloadPickup', pickupID) TimerManager.createTimerFor("map"):setTimer(ServerLoadPickup, tonumber(respawntime), 1, pickupID) end if pickup.type == 'repair' then fixVehicle(vehicle) elseif pickup.type == 'nitro' then addVehicleUpgrade(vehicle, 1010) elseif pickup.type == 'vehiclechange' then if getElementModel(vehicle) ~= tonumber(pickup.vehicle) then clientCall(source, 'alignVehicleWithUp') setVehicleID(vehicle, pickup.vehicle) setVehiclePaintjobAndUpgrades(vehicle, pickup.paintjob, pickup.upgrades) clientCall(source, 'vehicleChanging', g_MapOptions.classicchangez, tonumber(pickup.vehicle)) setTimer(function (ID) local pickup = g_Pickups[table.find(g_Pickups, 'id', ID)] pickup.vehicle = carIDS[math.random(#carIDS)] triggerClientEvent("changePickupText",root,pickup.id,pickup.vehicle) end, 60000, 1, pickup.id) end end triggerEvent('onPlayerPickUpRacePickup', source, pickupID, pickup.type, pickup.vehicle) end ) Link to comment
Jessie Posted March 1, 2012 Author Share Posted March 1, 2012 Ok, I've managed to change the pickup vehicle model and the text over it.-- add this to: race_client.lua: addEvent("changePickupText",true) addEventHandler("changePickupText",root, function (ID, newModel) for index, pickup in pairs(g_Pickups) do if (pickup.type == "vehiclechange" and pickup.id == ID) then pickup.vehicle = newModel pickup.label:text(getVehicleNameFromModel(newModel)) end end end ) -- edit this in race_server.lua: carIDS = { 602, 545, 496, 517, 401, 410, 518, 600, 527, 436, 589, 580, 419, 439, 533, 549, 526, 491, 474, 445, 467, 604, 426, 507, 547, 585, 405, 587, 409, 466, 550, 492, 566, 546, 540, 551, 421, 516, 529, 485, 552, 431, 438, 437, 574, 420, 525, 408, 416, 596, 433, 597, 427, 599, 490, 432, 528, 601, 407, 428, 544, 470, 598, 499, 588, 609, 403, 498, 514, 524, 423, 532, 414, 578, 443, 486, 515, 531, 456, 455, 459, 543, 422, 583, 482, 478, 605, 554, 530, 418, 572, 582, 413, 440, 536, 575, 534, 567, 535, 576, 412, 402, 542, 603, 475, 441, 564, 568, 424, 504, 495, 457, 483, 508, 71, 500, 429, 411, 541, 559, 415, 61, 480, 560, 562, 506, 565, 451, 434, 558, 494, 555, 502, 477, 503, 579, 400, 404, 489, 505, 479, 442, 458, 594 } addEvent('onPlayerPickUpRacePickup') addEvent('onPlayerPickUpRacePickupInternal', true) addEventHandler('onPlayerPickUpRacePickupInternal', g_Root, function(pickupID, respawntime) if checkClient( false, source, 'onPlayerPickUpRacePickupInternal' ) then return end local pickup = g_Pickups[table.find(g_Pickups, 'id', pickupID)] local vehicle = g_Vehicles[source] if not pickup or not vehicle then return end if respawntime and tonumber(respawntime) >= 50 then table.insert(unloadedPickups, pickupID) clientCall(g_Root, 'unloadPickup', pickupID) TimerManager.createTimerFor("map"):setTimer(ServerLoadPickup, tonumber(respawntime), 1, pickupID) end if pickup.type == 'repair' then fixVehicle(vehicle) elseif pickup.type == 'nitro' then addVehicleUpgrade(vehicle, 1010) elseif pickup.type == 'vehiclechange' then if getElementModel(vehicle) ~= tonumber(pickup.vehicle) then clientCall(source, 'alignVehicleWithUp') setVehicleID(vehicle, pickup.vehicle) setVehiclePaintjobAndUpgrades(vehicle, pickup.paintjob, pickup.upgrades) clientCall(source, 'vehicleChanging', g_MapOptions.classicchangez, tonumber(pickup.vehicle)) setTimer(function (ID) local pickup = g_Pickups[table.find(g_Pickups, 'id', ID)] pickup.vehicle = carIDS[math.random(#carIDS)] triggerClientEvent("changePickupText",root,pickup.id,pickup.vehicle) end, 60000, 1, pickup.id) end end triggerEvent('onPlayerPickUpRacePickup', source, pickupID, pickup.type, pickup.vehicle) end ) Thx! But, when i start my Local server. and i put the files in the map. + the lines in meta etc it says: could not find race_server.lua do you know what that error is coming ? Link to comment
Kenix Posted March 1, 2012 Share Posted March 1, 2012 <meta> <script src="race_server.lua" type="server"></script> <script src="race_client.lua" type="client"></script> <info gamemodes="race" type="map" name="[DD]MAPNAME" author="Jessie" version="1.0.0"></info> <map src="[DD]radiuslol.map" dimension="0"></map> <settings> <setting name="#skins" value='[ "cj" ]'></setting> <setting name="#maxplayers" value="[ 128 ]"></setting> <setting name="#gamespeed" value="[ 1 ]"></setting> <setting name="#ghostmode" value='[ "false" ]'></setting> <setting name="#time" value="12:0"></setting> <setting name="#vehicleweapons" value='[ "false" ]'></setting> <setting name="#minplayers" value="[ 0 ]"></setting> <setting name="#weather" value="[ 0 ]"></setting> <setting name="#gravity" value="[ 0.008000 ]"></setting> <setting name="#waveheight" value="[ 0 ]"></setting> <setting name="#respawntime" value="[ 5 ]"></setting> <setting name="#locked_time" value="[ false ]"></setting> <setting name="#duration" value="[ 1800 ]"></setting> <setting name="#respawn" value='[ "timelimit" ]'></setting> </settings> </meta> https://wiki.multitheftauto.com/wiki/Meta.xml In next time paste meta in code. Link to comment
Jessie Posted March 1, 2012 Author Share Posted March 1, 2012 (edited) ;p Edited March 1, 2012 by Guest Link to comment
Kenix Posted March 1, 2012 Share Posted March 1, 2012 You need put into race gm.( This code ) Ok, I've managed to change the pickup vehicle model and the text over it.-- add this to: race_client.lua: addEvent("changePickupText",true) addEventHandler("changePickupText",root, function (ID, newModel) for index, pickup in pairs(g_Pickups) do if (pickup.type == "vehiclechange" and pickup.id == ID) then pickup.vehicle = newModel pickup.label:text(getVehicleNameFromModel(newModel)) end end end ) -- edit this in race_server.lua: carIDS = { 602, 545, 496, 517, 401, 410, 518, 600, 527, 436, 589, 580, 419, 439, 533, 549, 526, 491, 474, 445, 467, 604, 426, 507, 547, 585, 405, 587, 409, 466, 550, 492, 566, 546, 540, 551, 421, 516, 529, 485, 552, 431, 438, 437, 574, 420, 525, 408, 416, 596, 433, 597, 427, 599, 490, 432, 528, 601, 407, 428, 544, 470, 598, 499, 588, 609, 403, 498, 514, 524, 423, 532, 414, 578, 443, 486, 515, 531, 456, 455, 459, 543, 422, 583, 482, 478, 605, 554, 530, 418, 572, 582, 413, 440, 536, 575, 534, 567, 535, 576, 412, 402, 542, 603, 475, 441, 564, 568, 424, 504, 495, 457, 483, 508, 71, 500, 429, 411, 541, 559, 415, 61, 480, 560, 562, 506, 565, 451, 434, 558, 494, 555, 502, 477, 503, 579, 400, 404, 489, 505, 479, 442, 458, 594 } addEvent('onPlayerPickUpRacePickup') addEvent('onPlayerPickUpRacePickupInternal', true) addEventHandler('onPlayerPickUpRacePickupInternal', g_Root, function(pickupID, respawntime) if checkClient( false, source, 'onPlayerPickUpRacePickupInternal' ) then return end local pickup = g_Pickups[table.find(g_Pickups, 'id', pickupID)] local vehicle = g_Vehicles[source] if not pickup or not vehicle then return end if respawntime and tonumber(respawntime) >= 50 then table.insert(unloadedPickups, pickupID) clientCall(g_Root, 'unloadPickup', pickupID) TimerManager.createTimerFor("map"):setTimer(ServerLoadPickup, tonumber(respawntime), 1, pickupID) end if pickup.type == 'repair' then fixVehicle(vehicle) elseif pickup.type == 'nitro' then addVehicleUpgrade(vehicle, 1010) elseif pickup.type == 'vehiclechange' then if getElementModel(vehicle) ~= tonumber(pickup.vehicle) then clientCall(source, 'alignVehicleWithUp') setVehicleID(vehicle, pickup.vehicle) setVehiclePaintjobAndUpgrades(vehicle, pickup.paintjob, pickup.upgrades) clientCall(source, 'vehicleChanging', g_MapOptions.classicchangez, tonumber(pickup.vehicle)) setTimer(function (ID) local pickup = g_Pickups[table.find(g_Pickups, 'id', ID)] pickup.vehicle = carIDS[math.random(#carIDS)] triggerClientEvent("changePickupText",root,pickup.id,pickup.vehicle) end, 60000, 1, pickup.id) end end triggerEvent('onPlayerPickUpRacePickup', source, pickupID, pickup.type, pickup.vehicle) end ) Link to comment
Jessie Posted March 1, 2012 Author Share Posted March 1, 2012 but i want it in my DD map on public servers. Link to comment
Castillo Posted March 1, 2012 Share Posted March 1, 2012 Well, you can make a setting in your map and then check it when you use a vehicle change pickup, I made the hard part, you can do the rest . Link to comment
Jessie Posted March 1, 2012 Author Share Posted March 1, 2012 Well, you can make a setting in your map and then check it when you use a vehicle change pickup, I made the hard part, you can do the rest . hm i dont get it. but thx anyway -Edit: Close topic please. 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