Jump to content

Ryder!

Members
  • Posts

    48
  • Joined

  • Last visited

Everything posted by Ryder!

  1. omg i love you ! it worked fine without guiSetInputEnable. So much time wasted finding out what it was I hope they fix this in next nighlty. Thanks
  2. i have no other resource running, i did "stopall" then start "mygamemode"
  3. hi, First, we call to a "login/register" gui and we show the cursor when client resource start. Then the user input their account and password and it's sent to the server, if everything is correct then they are logged in and we call to a client event that show their characters in a gridlist, so when they select one character and press a "select" button they are spawned and the cursor should hide but it not. function selectCharacter() local row, column = guiGridListGetSelectedItem ( acp_grd ) if row ~= -1 and column ~= -1 then destroyElement( ped ) destroyElement( acp_wnd ) removeEventHandler( "onClientRender", getRootElement(), rotatePed ) showCursor( false ) outputDebugString( tostring( isCursorShowing() ) ) --triggerServerEvent( "onClientSelectChar", getRootElement(), nick ) end end I get no errors and isCursorShowing() output "false" since the cursor is still there....
  4. i think you must cancel the event: dp2.3: "onClientChangeNick" 1.0: "onPlayerChangeNick" using cancelEvent()
  5. http://bugs.mtasa.com/view.php?id=4147
  6. we have this Server -- somewhere in the code... triggerClientEvent( client, "model_select", getRootElement(), skinModels ) --skinModels is a table Client function start_selection( tModels ) models = tModels --[[ .... some code .... ]] spawn() end function spawn() --math.randomseed( getTickCount() ) local model_id = math.random( 1, #models ) --[[ .... some code .... ]] end addEvent( "model_select", true ) addEventHandler( "model_select", getRootElement(), start_selection ) (just in case, the table models is correct, the problem is not with the table ) if i enter the server for first time, model_id will return 1. So i have to reconnect and the script will run correctly with no errors and model_id will return a correct random number. So i asked in irc and somebody told me to put math.randomseed( getTickCount() ) before generating the random number (model_id) and it worked perfectly. But later in newer nightlies this problem came back and the script wont work at all. So after doing some outputChatBox( getTickCount() ) i realized that it returned always 0 Right now im using r562
  7. hi, I want to get all player weapons when they quit the server and then send the data to the server for saving it into the sqlite db. My problem is with the "onClientResourceStop" event, it's possible to retrieve the client weapons in this event ? I'm asking it because it doesn't work for me This is what i have: Client: function onClientResourceStop( resource ) triggerServerEvent( "getAllClientWeapons", getRootElement() ) -- for testing the event --[[local count = 0 local weapons = {} while count ~= 12 do local wep = getPedWeapon( localPlayer, count ) local ammo = getPedTotalAmmo( localPlayer, count ) table.insert( weapons, wep, ammo ) count = count + 1 end triggerServerEvent( "getAllClientWeapons", getRootElement(), weapons )]] end addEventHandler( "onClientResourceStop", getResourceRootElement( getThisResource() ), onClientResourceStop ) Server: function allClientWeapons() outputServerLog( "wololo" ) -- no print --[[for weapon,ammo in pairs( weapons ) do local slot = getSlotFromWeapon ( weapon ) executeSQLQuery( "UPDATE startToday_players SET slot"..slot.." = ? WHERE nick = ?", weapon.." "..ammo, getPlayerName( client ) ) end]] end addEvent( "getAllClientWeapons", true ) addEventHandler( "getAllClientWeapons", getRootElement() , allClientWeapons ) if it's not possible to do this way, how can i do it ? =) Thanks bye!
  8. thanks! I did not realize that getPedTarget existed
  9. i'll explain mysefl, I'm trying to do a robbing system. So to rob the store the player must target one of the salesman ped ( defined in map file ) for x seconds but if he stop targetting the ped, the robbery fails.
  10. How can i do the same attaching the event to the root element ? it's possible ? Thanks again
  11. Thanks for your answer, The reason why i want to attach the event to some particular peds it's because i need to retrieve when the player is not targetting the ped anymore. This is what i want to do: function onTarget( element ) if not element then -- im sure that the player is not targetting the ped anymore because the event is attached to a particular ped. --my code end end addEventHandler( "onClientPlayerTarget", getElementByID("testPed"), onTarget ) I can't do the same by attaching the event to the root element because "my code" will be executed when i'm not targetting any element anymore.
  12. hi, why i can only attach the "onClientPlayerTarget" and "onPlayerTarget" (client side and server side) to the root element (getRootElement() ) it doesn't work if i attach those event to a ped for example. function onTarget(element) setPedAnimation( element, "ped", "handsup" ) end addEventHandler( "onClientPlayerTarget", getElementByID( "testPed" ), onTarget ) Map File: <ped id="testPed" posX="2089.5925292969" posY="2213.3474121094" posZ="10.8203125" model="0" /> Thanks bye
  13. hi, when i kill a ped inside a interior the re-enter the ped is alive also, setting a animation to a dead ped left the ped alive and invincible bugs or my code is wrong ? Thanks
  14. hi, here is the code: function inicio (res) result = mysql_query(link, "SELECT * FROM torneo_clanes") --get a list of team names while result do row = mysql_fetch_assoc(result) if (not row) then break end outputDebugString(row["clan"]) -- this debug string work great, it shows the list of team names from the mysql result asde = createTeam( row["clan"] ) -- the problem comes here, it return always [b]false[/b] if asde == true then outputDebugString("truecreate") else outputDebugString("falsecreate") end end end addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), inicio) What i get from debugstrings: [00:06:59] Starting torneo [00:07:00] INFO: loslojis //these are the team names from the mysql result [00:07:00] INFO: falsecreate [00:07:00] INFO: nubis [00:07:00] INFO: falsecreate [00:07:00] INFO: asdsad [00:07:00] INFO: falsecreate [00:07:00] INFO: jojoy [00:07:00] INFO: falsecreate [00:07:00] INFO: DanieloX [00:07:00] INFO: falsecreate thanks
  15. Hi, I have this problem with mta dm, look at these screenshots: As you can see, there's a "thing" at the end of the map coming from the midle of the screen to the top. This happens ALWAYS when i'm running no matters that it's night or day. The other problem i have is that the "drawdistance" is bugged, in the pictures you can see that i can see ALL the map without the gradient. Singleplayer: MTA:DM: Singleplayer: MTA:DM: =( I have an Ati Radeon 9600 256mb, AMD Sempron 2600+, 1GB Ram
  16. Hi, how can i register an account in this wiki http://development.mtasa.com/index.php?title=Main_Page i was learning about spawning vehicles but i found a wierd example Lol, check at this (the example part) http://development.mtasa.com/index.php? ... awnVehicle a not finished article or some idiot sabotaging the wiki? PD: sorry for my bad english :B
  17. Hi, my game crashes when im playing MTA race, it crash after 2-5 minutes.. The game freeze, and sometimes i have to reboot Amd sempron 2600+ 1gb ram Ati Radeon 9600 pro 256mb PD: I have san andreas version 1.0 Thanks
×
×
  • Create New...