Jump to content

crazyde21

Members
  • Posts

    27
  • Joined

  • Last visited

Everything posted by crazyde21

  1. When I create a GUI font and "guiSetFont" Everything is OK! But when I use other languages​​, such as Chinese, "guiSetFont" The Chinese have no effect! But English there is the effect!? Why? How to solve? Or "mtasa" not compatible? ————————————Gorgeous dividing line—————————————— Note: I use tool call "Font Creator" I tried one approach: that is, edit "TTF" file !!! Yes, you heard wrong when I edit "TTF" I found other languages ​​(Chinese)! Then: I right-click a word (Chinese) and click Properties,—> map—> I found the map Chinese fonts are Type "Unicode"! Such as "幼" is the word, it's "Unicode == $5E7C" (\ u5e7c) ~~(CJK Unified Ideographs) When I enter the "幼" is the word in the game, it does not change the system font ~ is ~ But when i use the Unicode "Basic Latin" it can work! As such I try to replace "Basic Latin" "CJK Unified Ideographs", For example, I copied a Chinese word and I covered the "ABCDEFG" then enter "A B C D E F G" in the game, it will work!! Then "ABCDEFG" will change to "幼幼幼幼幼幼幼", is the game in which he Compatible "Basic Latin" ————————————Gorgeous dividing line—————————————— This in the end how to do? Let "TTF" font directly compatible with other languages ​​(Chinese)?
  2. Who can be my script as a reference, write a server rotation function? Ped and make moving?
  3. if i use "setPedAnimation" , the ped can only go in a straight line~ how to write?
  4. You mean: I have to write server function so that others can see ped move?? , But I can not write server functions, what with a few function? setPedAnimation setPedAnimationProgress setPedArmor setPedChoking setPedDoingGangDriveby setPedFightingStyle setPedFrozen setPedGravity setPedHeadless setPedOnFire setPedSkin setPedStat setPedWeaponSlot Which? function
  5. My question is: Is it just add "if setPedControlState (ped1," right ", false) then" execution, others can see ped move?
  6. I want to make a simple script. Enter the command to create ped, then I want to use "w / s / a / d" to control him, I do not know how to move ped, my "client script" using "setPedControlState", but others can not see ped move! and next is my script... client addEvent("test1",true) addEventHandler("test1",getRootElement(),function(ped1) function updateCamera ( ) local x, y, z = getElementPosition ( ped1 ) local px, py, pz = getElementPosition ( getLocalPlayer() ) setCameraMatrix ( px, py, pz+10, x, y, z ) setPedCameraRotation (ped1,getPedCameraRotation(getLocalPlayer())) end addEventHandler ( "onClientRender", getRootElement(), updateCamera ) function leftdown ( key,keyState ) rx,ry,rz=getElementRotation ( ped1 ) rz=rz+45 --setPedControlState ( ped1, "left", true ) triggerServerEvent("test3",getLocalPlayer(),keyState,rx,ry,rz) end function leftup ( key,keyState ) --if getPedControlState ( ped1,"left" )then --setPedControlState ( ped1, "left", false ) triggerServerEvent("test3",getLocalPlayer(),keyState,rx,ry,rz) --end end function rightdown ( key,keyState ) rx,ry,rz=getElementRotation ( ped1 ) rz=rz-45 --setPedControlState ( ped1, "right", true ) triggerServerEvent("test3",getLocalPlayer(),keyState,rx,ry,rz) end function rightup ( key,keyState ) --if getPedControlState ( ped1,"right" )then --setPedControlState ( ped1, "right", false ) triggerServerEvent("test3",getLocalPlayer(),keyState,rx,ry,rz) --end end function forwardsdown ( key,keyState ) rx,ry,rz=getElementRotation ( ped1 ) rz=rz --setPedControlState ( ped1, "forwards", true ) triggerServerEvent("test3",getLocalPlayer(),keyState,rx,ry,rz) end function forwardsup( key,keyState ) --if getPedControlState ( ped1,"forwards" )then --setPedControlState ( ped1, "forwards", false ) triggerServerEvent("test3",getLocalPlayer(),keyState,rx,ry,rz) --end end function backwardsdown ( key,keyState ) --setPedControlState ( ped1, "backwards", true ) triggerServerEvent("test3",getLocalPlayer(),keyState,rx,ry,rz) end function backwardsup ( key,keyState ) --if getPedControlState ( ped1,"backwards" )then --setPedControlState ( ped1, "backwards", false ) triggerServerEvent("test3",getLocalPlayer(),keyState,rx,ry,rz) --end end function jumpdown ( ) --setPedControlState ( ped1, "jump", true ) end function jumpup ( ) --if getPedControlState ( ped1,"jump" )then --setPedControlState ( ped1, "jump", false ) --end end function sprintdown ( ) --setPedControlState ( ped1, "sprint", true ) end function sprintup ( ) --if getPedControlState ( ped1,"sprint" )then --setPedControlState ( ped1, "sprint", false ) --end end function renwuboom() unbindKey("g","down",renwuboom) setTimer ( playSound, 1000, 1, "sounds/daoshu321.wav" ) setTimer ( outputChatBox, 1000, 1, "人肉炸弹倒计时3" ) setTimer ( outputChatBox, 2000, 1, "人肉炸弹倒计时2") setTimer ( outputChatBox, 3000, 1, "人肉炸弹倒计时1" ) setTimer (function() triggerServerEvent("test2",getLocalPlayer(),getElementPosition ( ped1 )) playSound("sounds/boom.mp3") removeEventHandler("onClientRender", getRootElement(), updateCamera) fadeCamera(false,1.0,255,255,0) end,4000,1) setTimer ( fadeCamera, 5000, 1, true, 0.5 ) setTimer ( function() setCameraTarget(getLocalPlayer()) unbindKey("a","down",leftdown) unbindKey("a","up",leftup) unbindKey("d","down",rightdown) unbindKey("d","up",rightup) unbindKey("w","down",forwardsdown) unbindKey("w","up",forwardsup) unbindKey("s","down",backwardsdown) unbindKey("s","up",backwardsup) unbindKey("lshift","down",jumpdown) unbindKey("lshift","up",jumpup) unbindKey("space","down",sprintdown) unbindKey("space","up",sprintup) end, 6000, 1 ) end bindKey("g","down",renwuboom) bindKey("a","down",leftdown) bindKey("a","up",leftup) bindKey("d","down",rightdown) bindKey("d","up",rightup) bindKey("w","down",forwardsdown) bindKey("w","up",forwardsup) bindKey("s","down",backwardsdown) bindKey("s","up",backwardsup) bindKey("lshift","down",jumpdown) bindKey("lshift","up",jumpup) bindKey("space","down",sprintdown) bindKey("space","up",sprintup) end ) server xianzhizhadan=0 function Createyaokongche(thePlayer) xianzhizhadan=xianzhizhadan+1 if xianzhizhadan==1 then setElementFrozen(thePlayer,true) toggleAllControls ( thePlayer,false) local x,y,z=getElementPosition(thePlayer) local rx,ry,rz = getElementRotation ( thePlayer ) ped1 = createPed(56,x,y+5,z) outputChatBox("人肉炸弹启动!WSAD控制移动,G倒数引爆",thePlayer) triggerClientEvent(thePlayer,"test1",getRootElement(),ped1) end end addCommandHandler("人肉炸弹",Createyaokongche) addEvent("test2",true) addEventHandler("test2",getRootElement(),function(x,y,z) destroyElement(ped1) createExplosion(x,y,z,0,source) setElementFrozen(source,false) setTimer(toggleAllControls ,2000,1,source,true) xianzhizhadan=0 end ) addEvent("test3",true) addEventHandler("test3",getRootElement(),function(statn,rx,ry,rz) outputChatBox("statn状态为:"..statn) if statn=="down"then local zhuanshen=setPedRotation(ped1,rz) if zhuanshen then setPedAnimation(ped1,"ped", "run_player") end end if statn=="up"then setPedRotation(ped1,rz) setPedAnimation(ped1,false) end end )
  7. you can give me The complete code yet?
  8. How to set: black screen when transmitted?
  9. function stopDamage () if getElementType(source) == "player" then cancelEvent() end end addEventHandler ( "onClientPlayerDamage", getLocalPlayer(), stopDamage ) this ok!
  10. function stopDamage ( att ) target = getPedTarget ( att ) local typename =getElementType(target) if typename == "player" then cancelEvent() end end addEventHandler ( "onClientPlayerDamage", getRootElement(), stopDamage ) Have hurt,too!
  11. onClientPlayerDamage when i Fall down, I always death!
  12. When the player hurt myself , Then how cancel event? Was someone else kill you!
  13. ok im ok. button = guiCreateButton( 0.7, 0.1, 0.2, 0.1, "Output!", true ) missionimage =guiCreateStaticImage(0, 0.05, 1, 0.9,"images/palette.png", true,button) guiSetAlpha ( missionimage, 0.5) guiSetEnabled ( missionimage, false )
  14. im ok , then my lua is function playerPressedKey(button, press) if not(press) and button=='lalt' then triggerEvent ( "uncallQ", root ) triggerEvent ( "uncallE", root ) end if (press) and button=='lalt' then triggerEvent ( "callQ", root ) triggerEvent ( "callE", root ) end end addEventHandler("onClientKey", root, playerPressedKey) and addEvent ( "callQ", true ) addEventHandler ( "callQ", root, function() bindKey ( "q", "down", bindQ ) end ) addEvent ( "uncallQ", true ) addEventHandler ( "uncallQ", root, function() unbindKey ( "q", "down", bindQ ) end ) function bindQ ( ) if ( guiGetVisible ( mission2.window[1] ) == true ) then guiSetVisible ( mission2.window[1], false ) showCursor( false ) else triggerServerEvent("checkzt",getLocalPlayer(),getLocalPlayer()) guiSetVisible ( mission2.window[1], true ) showCursor( true ) end end
  15. I want to use the Picture button in the GUI inside, if I move the mouse to brighten the picture then the picture, click can triggerEvent
  16. --I mean is: can i use ("lalt" key and "e" key) --to Trigger olther functions? . For example: i press ("lalt"+"E") --then outputChatBox("You just press \"lalt\"+\"E\"!!!") Use what Function? onClientKey bindKey --or what Function?who can give me an example?
  17. guiCreateEdit guiCreateButton function clickplayers ( button, state, absoluteX, absoluteY, worldX, worldY, worldZ, clickedElement ) if button=="left" then if state =="down" then if getElementType ( clickedElement ) =="player" then if clickedElement != getLocalPlayer() then --check isn't me. triggerEvent ( "chatboxSend", getLocalPlayer() ) -- me chat box triggerEvent ( "chatboxTO", clickedElement ) -- player chat box end end end end end addEventHandler ( "onClientClick", getRootElement(), clickplayers ) addEvent ( "chatboxTO", true ) function playerchatbox ( ) guiCreateWindow(0.34, 0.31, 0.28, 0.30, "chatbox", true) guiWindowSetSizable(window[1], false) end addEventHandler ( "chatboxTO", root, playerchatbox ) addEvent ( "chatboxSend", true ) function mychatbox ( ) guiCreateWindow(0.34, 0.31, 0.28, 0.30, "chatbox", true) guiWindowSetSizable(window[1], false) end addEventHandler ( "chatboxSend", root, mychatbox ) See and my Q: how to create an GUI chat box, and my friend talk? .text in"guiCreateEdit " , button send text!
  18. When the vehicle nobody, then setTimer 1 minute respawn vehicles, within 1 minute if someone on the bus on killTimer. otherwise one minute after the respawn of the vehicle! How to do that?
  19. client bindKey ("m", "down", function() showCursor( not isCursorShowing() ) end) function clickplayers ( button, state, absoluteX, absoluteY, worldX, worldY, worldZ, clickedElement ) if button=="left" then if state =="down" then zhuishap = clickedElement if getElementType ( clickedElement ) =="player" then local x,y,z =getElementPosition (clickedElement) triggerServerEvent ( "shunyi", getLocalPlayer(),x,y,z,clickedElement ) end end end end addEventHandler ( "onClientClick", getRootElement(), clickplayers ) addEvent( "fireplayers", true ) addEventHandler( "fireplayers", getRootElement(), function ( huwei,x,y,z ) if (isElement(huwei)) then setPedAimTarget ( huwei, x,y,z+0.85 ) setPedControlState( huwei, "fire", true ) setTimer ( function (huwei) if ( isElement ( huwei ) ) then setPedControlState ( huwei, "fire", false) end end, 100, 1, huwei ) end end ) function wpplayerss( huwei ) if (isElement(huwei)) then local x,y,z = getElementPosition(zhuishap) setPedControlState( huwei, "fire", true ) setPedControlState( huwei, "aim_weapon", true ) setTimer ( function (huwei) setPedAimTarget ( huwei, x,y,z+0.8 ) end , 100, 1, huwei ) setTimer ( function (huwei) setPedControlState ( huwei, "fire", false) wpplayerss(huwei) end, 100, 1, huwei ) end end addEvent( "wpplayers", true ) addEventHandler( "wpplayers", getRootElement(), wpplayerss) server outputChatBox("10086兄开发简单护卫启动...",player,255,255,0) huwei=createPed ( 114, 0,0,5) addEvent("shunyi",true) addEventHandler("shunyi",getRootElement(),function(x,y,z,clickedElement) local checkwp = getPedWeapon (huwei ) if checkwp == 0 then setPedOnFire (clickedElement,true) setElementFrozen (clickedElement,true) setPedArmor (huwei,100) setTimer ( function()setElementFrozen (clickedElement,false) end ,2000,1) setElementPosition(huwei,x+1,y,z) setPedAnimation ( huwei ) triggerClientEvent ( "fireplayers", getRootElement(), huwei ,x,y,z) end if checkwp > 0 then giveWeapon(huwei,checkwp,1,true) setElementPosition(huwei,x+5,y+5,z) setPedAnimation ( huwei ) triggerClientEvent ( "wpplayers", getRootElement(), huwei) end end ) function resheng() huwei=createPed ( 114, 0,0,5) function died(ammo,killer) outputChatBox("护卫已经死亡,杀手是:"..getPlayerName(killer)..",护卫10秒后复活",player,255,255,0) setTimer ( function() destroyElement (huwei) outputChatBox("护卫死亡已经复活!",player,255,0,0) resheng()end ,10000,1) end addEventHandler("onPedWasted", huwei, died) end function died(ammo,killer) outputChatBox("护卫已经死亡,杀手是:"..getPlayerName(killer)..",护卫10秒后复活",player,255,255,0) setTimer ( function() destroyElement (huwei) outputChatBox("护卫死亡已经复活!",player,255,0,0) resheng()end ,10000,1) end addEventHandler("onPedWasted", huwei, died) addCommandHandler("huweiskin",function(thePlayer,cmd,id) if id then setPedSkin(huwei,id) else outputChatBox("请使用命令/huweiskin 皮肤id ,换护卫的皮肤",thePlayer,255,255,255) end end ) addCommandHandler("huweiwp",function(thePlayer,cmd,id) if id then giveWeapon(huwei,id,1000,true) reloadPedWeapon(huwei) else outputChatBox("请使用命令/huweiwp 武器id ,给护卫武器",thePlayer,255,255,255) end end ) createPed ( 114, -2405.35522 ,-594.86493 ,132.64844) my Q is: I press "M" call Mouse ,then click player ,if getpedweapon == 0 then fire the player, player injuries!! .But weapon > 0 , then i click the player , ped will fire and shot clickElement, but No injuries! why it?
  20. Label Font Size setting is invalid!
  21. What did you say? I want to set the Chinese fonts.
  22. I want to set the font of label . But Chinese invalid! Such as: GUIEditor = { label = {} } addEventHandler("onClientResourceStart", resourceRoot, function() GUIEditor.label[1] = guiCreatelabel(364, 238, 124, 77, "你好=hello", false) local font_0 = guiCreateFont(":guieditor/fonts/simsun.ttf",18) guiSetFont(GUIEditor.label[1], font_0) guiSetProperty(GUIEditor.label[1], "NormalTextColour", "FFAAAAAA") end ) set the font of label text"你好"invalid, but english hello Useful !!
  23. How can I modify? I want the players to accept the task, and then create a marker, When players enter the marker to complete the task. But my script, I have to take the task, but others can do! client --[[------------------------------------------------- Notes: > This code is using a relative image filepath. This will only work as long as the location it is from always exists, and the resource it is part of is running. To ensure it does not break, it is highly encouraged to move images into your local resource and reference them there. --]]------------------------------------------------- mission = { gridlist = {}, window = {}, staticimage = {}, button = {}, label = {} } mission.window[1] = guiCreateWindow(198, 77, 385, 516, "mission", false) guiWindowSetSizable(mission.window[1], false) guiSetAlpha(mission.window[1], 1.00) mission.staticimage[1] = guiCreateStaticImage(9, 22, 366, 484, ":olsystem/images/palette.png", false, mission.window[1]) mission.gridlist[1] = guiCreateGridList(0, 0, 177, 485, false, mission.staticimage[1]) guiGridListAddColumn(mission.gridlist[1], "mission list", 0.4) guiGridListAddColumn(mission.gridlist[1], "Status", 0.4) guiGridListAddRow(mission.gridlist[1]) guiGridListSetItemText(mission.gridlist[1], 0, 1, "Police", false, false) guiGridListSetItemText(mission.gridlist[1], 0, 2, "X", false, false) mission.gridlist[2] = guiCreateGridList(178, 0, 188, 484, false, mission.staticimage[1]) guiGridListAddColumn(mission.gridlist[2], " ", 0.9) mission.label[1] = guiCreateLabel(43, 4, 88, 17, "", false, mission.gridlist[2]) guiLabelSetHorizontalAlign(mission.label[1], "center", false) mission.label[2] = guiCreateLabel(2, 30, 186, 322, "", false, mission.gridlist[2]) mission.button[1] = guiCreateButton(107, 437, 81, 47, "Close", false, mission.gridlist[2]) guiSetProperty(mission.button[1], "NormalTextColour", "FFFFFFFF") mission.button[2] = guiCreateButton(12, 437, 81, 47, "accept", false, mission.gridlist[2]) guiSetProperty(mission.button[2], "NormalTextColour", "FFFFFFFF") guiSetVisible(mission.window[1],false) cjped=createPed ( 147, 2514.76758,-1673.75623,13.67720 ,80) setElementFrozen ( cjped, true ) function addLabelOnClick ( button, state, absoluteX, absoluteY, worldX, worldY, worldZ, clickedElement ) if state =="down" then if ( clickedElement )==cjped then guiSetVisible(mission.window[1],true) end end end addEventHandler("onClientGUIClick", getRootElement(), function () local row = guiGridListGetItemText ( mission.gridlist[1], guiGridListGetSelectedItem ( mission.gridlist[1] ), 1 ) if row == "Police" then guiSetText ( mission.label[1], "Police" ) guiSetText ( mission.label[2], "Brian:\nFriends,I need your help\nLack of material \nsecurity zone, can you help me\nPolice look to see." ) end end ) addEventHandler ( "onClientClick", getRootElement(), addLabelOnClick ) bindKey ("m", "down", function() showCursor( not isCursorShowing() ) end) function cancelPedDamage ( attacker ) cancelEvent() end addEventHandler ( "onClientPedDamage", cjped, cancelPedDamage ) addEventHandler("onClientGUIClick", mission.button[1],function() guiSetText ( mission.label[1], "" ) guiSetText ( mission.label[2], "" ) guiSetVisible(mission.window[1],false) showCursor(false) end ) addEventHandler("onClientGUIClick", mission.button[2], function() local player=getLocalPlayer() local row = guiGridListGetItemText ( mission.gridlist[1], guiGridListGetSelectedItem ( mission.gridlist[1] ), 1 ) if row == "Police" then local name=getPlayerName(getLocalPlayer()) triggerServerEvent("jjrw",getLocalPlayer(),name,player) end end ) addEvent("jjrwz",true) addEventHandler("jjrwz",getRootElement(), function(RW2) local name=getPlayerName(getLocalPlayer()) if tonumber(RW2)==0 then outputChatBox("You do not have to accept the mission!") end if tonumber(RW2)==1 then outputChatBox("mission completed!") triggerServerEvent("wcjjrw",getLocalPlayer(),name) end if tonumber(RW2)==2 then outputChatBox("You can not do this task!") end end ) server handler = mysql_connect( host, username, password, db ) addEvent("jjrw",true) addEventHandler("jjrw",getRootElement(), function(name) local result = mysql_query(handler, "SELECT RW2 FROM players WHERE Username='"..name.."'") for result,row in mysql_rows(result) do mysql_field_seek(result, 1) for k,RW2 in ipairs(row) do local field = mysql_fetch_field(result) if tonumber(RW2)== 2 then outputChatBox("* Before you have completed this task!",source,255,255,255,true) else mysql_query(handler,"UPDATE `players` SET RW2=1 WHERE`Username`= '"..name.."'") jjrw = createMarker (1553.51794,-1675.84668,15.19531, "cylinder", 1.5, 255, 255, 0, 170 ) outputChatBox("* You accept the".."police".."take!",source,255,255,255,true) function MarkerHit (thePlayer) local name=getPlayerName(thePlayer) triggerEvent("checkjjrw",thePlayer,name) end addEventHandler ( "onMarkerHit", jjrw, MarkerHit ) end end end end ) addEvent("checkjjrw",true) addEventHandler("checkjjrw",getRootElement(),function(name) local result = mysql_query(handler, "SELECT RW2 FROM players WHERE Username='"..name.."'") for result,row in mysql_rows(result) do mysql_field_seek(result, 1) for k,RW2 in ipairs(row) do triggerClientEvent("jjrwz",getRootElement(),RW2) destroyElement ( jjrw ) end end end ) addEvent("wcjjrw",true) addEventHandler("wcjjrw",getRootElement(),function(name) mysql_query(handler,"UPDATE `players` SET RW2=2 WHERE`Username`= '"..name.."'") mysql_query(handler,"UPDATE `players` SET Money=Money+500 WHERE`Username`= '"..name.."'") end ) this is use"Mysql"save mission!
  24. Thank you for your suggestion. Problem solved! Thank
×
×
  • Create New...