Jump to content

Zafire

Members
  • Posts

    25
  • Joined

  • Last visited

Everything posted by Zafire

  1. thx but that give me the ID of the weapon?.. because in the same slot i can have a UZI or a MP5 or a TEC9
  2. Hey, how i can take WEAPON id of the player has in his hands.. i need to use it in addEventHandler('onClientPlayerWeaponSwitch',jugador,function(prevSlot,currSlot) so i need a function give me the weapon id the player have in his hands
  3. Zafire

    Stats system

    yes it can be many things.. but if you want for load/save data, i recommend u.. use mysql
  4. thxx it works perfect, but the tickSound dont works, i think its because is disabled control Fire.. but its fine..
  5. How i can dissablee, the player use f11 for look the map
  6. no, i want when player have "0" ammo, gta sa dont DELETE the weapon, i want to the player have the weapon in his hand with 0 ammo.. he cant use it, but the weapon dont dissapear
  7. thxx.. but that function will give a player the weapon to the player with 0 ammo?..
  8. mm good u use xml !.. i can use mysql too i think for save load data thx.. i will work on it.. i think mysql its better because you can manage mysql with the server and a web page with php.. so u can make a good connection on a webpage php + server mta
  9. xml?.. i can do it with mysql its better?.. load the data from mysql.. i use it now for register users in the gm i am making.. and load dialogs, etc
  10. Hey, i want to create an inventory system.. for put items like notes, or materials i create, bullets, etc.. but i dont knooow how to start , suggestions?
  11. Its possible to make that?.. when somebody dont have more ammo, the weapon dont dissapear?
  12. Zafire

    Take anim

    mmm thanks i only needed an animation that look like take something from the ground.. i use this anim setPedAnimation(player, "BOMBER", "BOM_Plant" , 3000, false) it looks good.. but you give me an idea with attachElements.. i can make more rol with that, thanks..
  13. Zafire

    Take anim

    Hi, exist an animation.. like the player take something an object or item from the floor?
  14. i use crearDialogoUsuario(text, time) for create a dialog, and show it X time.. It works.. but if i use this function 2 times at the same time example crearDialogoUsuario("Hi, how are you", 4000) crearDialogoUsuario("Bye", 4000) that 2 dialog will appear at the same time, and i dont want that.. i want the second appears when the first finish.. before 4 seconds.. so i create crearDialogoUsuario(text, time, delay) this function supose will white the "delay" i use for show the dialog.. but it doesnt works using this crearDialogoUsuario("Hi, how are you", 4000) crearDialogoUsuarioDelay("Bye", 4000, 4000) and my function is ----------------------------------- Dialogo Usuario con Delay ------------------------------------ function crearDialogoUsuarioDelay(text, time, delay) setTimer(crearDialogoUsuario, delay, 1, text, time) end -------------------------------------------------------------------------------------------------------- when i use it.. say Bad Argumen @ in triggerclientevent here ---------------------------------------- Dialogo Usuario ----------------------------------------- function crearDialogoUsuario(text, time) triggerClientEvent(client, "formatearDialogo", getRootElement(), text, time) end --------------------------------------------------------------------------------------------------
  15. hahahahahaha !!!! i want create a function loading data for every single player.. so when in my code i use OnPlayerLogin giveplayermoney(data[player]["money"]) after load the data.. it works for every single player.. will work like this for "pedro" giveplayermoney(data["pedro"]["money]) will work like this for jose giveplayermoney(data["jose"]["money]).. (I know maybe that code is bad, its only for xplain it).. and with the function i create i fix it.. because now i can do the same, and without loading ALL the data of the player.. and works for everysingle player like this.. giveplayermoney(stat(player, "money")) will work like this for "pedro" giveplayermoney(stat("player", "money")) and like this for jose giveplayermoney(stat("jose", "money"))
  16. thxx i want that for single player.. example a user name is "pedro" and i want to in a function use dato["pedro"]["money"] for single player.. so if another player enter example "jose" use dato["jose"]["money] so dato["pedro"]["money"] and dato["jose"]["money] are not the same.. but if i use dato = mysql_fetch_assoc(resultado) will be a bug, because will be not a var for single player.. if u givemoney to player using dato["money"] maybe another player login.. and will use that money.. will be buggy.. but i fix this, using another thing is better -------------------------------------- Stat del Usuario --------------------------------------- function stat(usuario, dato) local resultado = mysql_query(coneccion_mysql, "SELECT * FROM usuarios WHERE usuario='"..usuario.."'") local datos = mysql_fetch_assoc(resultado) return datos[dato] end ----------------------------------------------------------------------------------------------- this is better because i can use stat("pedro", "money) and this function make a Return of that value.. is perfect
  17. I need help here, because my first function works, but the second is a Delayed function, so when i use it star a timer for use the first function before X seconds ---------------------------------------- Dialogo Usuario ----------------------------------------- function crearDialogoUsuario(texto, duracion) triggerClientEvent(client, "formatearDialogo", getRootElement(), texto, duracion) end -------------------------------------------------------------------------------------------------- ----------------------------------- Dialogo Usuario con Delay ------------------------------------ function crearDialogoUsuarioDelay(texto, duracion, delay) setTimer(crearDialogoUsuario, delay, 1, texto, duracion) end -------------------------------------------------------------------------------------------------- but in my SetTimer function, i cant export the vars there.. .. if i use my first function vars "texto", "duracion" works perfect.. but in the second one i have setTimer so i dont know to use the vars there.. dont works because the delayed function dont take the vars..
  18. thxx for help!! but i try and try before you help me and i create i function for take a single data for the player i want i use this.. function stat(usuario, dato) local resultado = mysql_query(coneccion_mysql, "SELECT * FROM usuarios WHERE usuario='"..usuario.."'") local datos = mysql_fetch_assoc(resultado) return datos[dato] end jeje, i am from Venezuela
  19. Hi, i need to create multi-dimensional arrays for load data of a player from a mysql table i have this ----------------------------------------- Cargar Stats ---------------------------------------- function cargarStats(usuario) local resultado = mysql_query(coneccion_mysql, "SELECT * FROM usuarios WHERE usuario='"..usuario.."'") dato[player] = mysql_fetch_assoc(resultado) end ----------------------------------------------------------------------------------------------- but it doesnt works, i think you understand me i want to load data of a player so i need something like data[player]["money"].. i have to use that player because if something login and his name is Maria i use data["Maria"]["money"].. if i dont use that array for everyonee single user, will be buggy because will be the same var for all.. Help me pls, thx god bless u
  20. i use this ----------------------------------------- Cargar Stats ---------------------------------------- function cargarStats(usuario) local resultado = mysql_query(coneccion_mysql, "SELECT * FROM usuarios WHERE usuario='"..usuario.."'") dato[player] = mysql_fetch_assoc(resultado) end ----------------------------------------------------------------------------------------------- [code] And dont work
  21. Hi, i need help with these y will use mysql_fetch_asocc(query) but i need the variable name for that come from another variable, so example here is my code function cargarStats(usuario) local query = "SELECT * FROM usuarios WHERE usuario="..usuario local resultado = mysql_query(query) dato = mysql_fetch_assoc(result) end Look, now when i use for example cargarStats(zafire) i want my code work like something like this.. function cargarStats(zafire) local query = "SELECT * FROM usuarios WHERE usuario="..zafire local resultado = mysql_query(query) zafire = mysql_fetch_assoc(result) end look at Zafire = mysql_fetch_assoc(result) so there i will have vars like zafire["money"] the point of this is use that vars for every single player..
  22. Hi, i make a script for load vehicles from a mysql tablee.. if works perfectly but now i want to store vehicles id and data or something like that in a gloval array? its possible? something like this car[id][selling] = 0 ... things like that because i want to make functions using foreach and modify things an blabla so i need to store that in arrays.. how to do that? only i need an example.. here is something of my code -- Funcion para Cargar los Vehiculos ---------------------------------------------- function cargarVehiculos() local vehnum = 0 local resultado = mysql_query(sql_connect, "SELECT * FROM vehiculos ORDER BY id ASC") if(resultado) then while true do local row = mysql_fetch_assoc(resultado) if(not row) then break end local vehiculo = createVehicle(row["modelo"], row["x"], row["y"], row["z"]) setVehicleColor(vehiculo, row["color1"], row["color2"], row["color1"], row["color2"]) if(row["encendido"] == "no") then setVehicleEngineState(vehiculo, false) else setVehicleEngineState(vehiculo, true) end if(row["cerrado"] == "no") then setVehicleLocked(vehiculo, false) else setVehicleLocked(vehiculo, true) end vehnum = vehnum + 1 end end return vehnum end -----------------------------------------------------------------------------------
  23. sql type is INT in cerrado(locked) in encendido too..
  24. thxx for that but i want someone xplain me why the car dont lock, because i want to create my own script and leanr
  25. I make this script and works it load vehicles put te correct color all, the unique problem is the script dont lock or unlock the cars or turn engine off on.. when i enter in any car it is not locked and the engine is turn on!.. maybe can you help me? function cargarVehiculos() local vehnum = 0 local resultado = mysql_query(sql_connect, "SELECT * FROM vehiculos ORDER BY id ASC") if(resultado) then while true do local row = mysql_fetch_assoc(resultado) if(not row) then break end local vehiculo = createVehicle(row["modelo"], row["x"], row["y"], row["z"]) setVehicleColor(vehiculo, row["color1"], row["color2"], row["color1"], row["color2"]) if(row["encendido"] == 1) then setVehicleEngineState(vehiculo, true) else setVehicleEngineState(vehiculo, false) end if(row["cerrado"] == 1) then setVehicleLocked(vehiculo, true) else setVehicleLocked(vehiculo, false) end vehnum = vehnum + 1 end end return vehnum end Thanks
×
×
  • Create New...