Jump to content

jingzhi

Members
  • Posts

    288
  • Joined

  • Last visited

Everything posted by jingzhi

  1. Then it's strange, I can't tell why this script doesn't run good. It only works when it's playing the sound for one player only, when it plays for the second player the first player can not hear it anymore. function engine_func() local veh = getPedOccupiedVehicle (localPlayer) local RPM = getVehicleRPM(veh) setElementData(veh,"RPM",RPM) if veh then if getVehicleEngineState (veh) == true then setSoundVolume(local_sound,1) setSoundSpeed(local_sound, RPM * 2.5 / 10000) else if getSoundVolume(local_sound) == 1 then setSoundVolume(local_sound,0) end end else destroyElement(local_sound) removeEventHandler("onClientRender",root,engine_func) end end addEventHandler ( "onClientVehicleEnter", getRootElement(), function() if getElementModel ( source ) == 411 then setWorldSoundEnabled(40,false) local x,y,z = getElementPosition(source) if vehicles[source] then vehicles[source] = nil end local_sound = playSound3D(engine_sound, x, y, z, true) setSoundVolume(local_sound,0) attachElements(local_sound,source) addEventHandler ( "onClientRender", getRootElement(), engine_func ) end end) addEventHandler ( "onClientVehicleExit", getRootElement(), function() if getElementModel(source) == 411 then setWorldSoundEnabled(40,true) destroyElement(local_sound) removeEventHandler ( "onClientRender", getRootElement(), engine_func ) end end)
  2. Then it's very strange, this shouldn't be happening, here is the related scripts function engine_func() local veh = getPedOccupiedVehicle (localPlayer) local RPM = getVehicleRPM(veh) setElementData(veh,"RPM",RPM) if veh then if getVehicleEngineState (veh) == true then setSoundVolume(local_sound,1) setSoundSpeed(local_sound, RPM * 2.5 / 10000) else if getSoundVolume(local_sound) == 1 then setSoundVolume(local_sound,0) end end else destroyElement(local_sound) removeEventHandler("onClientRender",root,engine_func) end end addEventHandler ( "onClientVehicleEnter", getRootElement(), function() if getElementModel ( source ) == 411 then setWorldSoundEnabled(40,false) local x,y,z = getElementPosition(source) if vehicles[source] then vehicles[source] = nil end local_sound = playSound3D(engine_sound, x, y, z, true) setSoundVolume(local_sound,0) attachElements(local_sound,source) addEventHandler ( "onClientRender", getRootElement(), engine_func ) end end) addEventHandler ( "onClientVehicleExit", getRootElement(), function() if getElementModel(source) == 411 then setWorldSoundEnabled(40,true) destroyElement(local_sound) removeEventHandler ( "onClientRender", getRootElement(), engine_func ) end end)
  3. Hello everybody, I have been working on a script recently and got a problem which seems like 2 variables on the Client side overwriting each other (on two different clients) local_sound = playSound3D(sound, x, y, z, true) When I try to play this sound for 2 players at the same time the local_sound variable gets overwrited so only the player who played sound second will hear the sound and the first player won't be able to hear it anymore. Any thought / help ?
  4. S3N, this is Zhi Jing, use mysql or the setAccountData to help you
  5. Hello everyone, Can I use playSound more than once at the same time for a single sound file?
  6. jingzhi

    Help

    I don't you can use more than one weapon skin, you can only change the existing one
  7. Post the full code so that we can help you
  8. You can simply use the ratio between Full HD screen resolution and player's resolution and multiply by this ratio in every variable in the dxDraw Functions.
  9. Show clientside scripts.
  10. Put 500 instead of 10000 in "maxVelocity"
  11. I suppose paintjobs are DFF files?
  12. AccountData of "cash" is nil, maybe you didnt set it correctly
  13. Use killPed when the player is out of the game and don't respawn him and focus this player's camera on other players.
  14. MySQL Is For The Big Projects .. Thats because I think everyone has a big dream
  15. 即可获取到服务器人数信息 更改颜色 在mtasa.php里搜索imagecolorallocate($sign, 255, 255, 255); 里面的255依次表示为RGB颜色代码, 可根据喜好修改 例如黑色是0, 0, 0 注意事项 此程序默认支持的服务器字符串长度为<=9, 例如999/999. 当字符串长度>9将无法获取到服务器人数, 这时需要手动制作适应的图片放到images目录下并给其命名为imagex(x代表该图片适应的长度).png 赞助 如果你觉得此程序不错, 请赞助我们以便我们有动力开源更多项目. 支持 支付宝 PayPal 具体请私信给我或者联系QQ947585287 这也拿出来卖钱?
  16. jingzhi

    Help Me

    I think you are not supposed to decompile anyone's script
  17. Show the giveMeWeapon function cause I dont see any operation related to tables here
×
×
  • Create New...