βurak
Members-
Posts
370 -
Joined
-
Last visited
-
Days Won
21
Everything posted by βurak
-
There is no reason for you to do this check for the combo box, if you want to check it with the player's input, it may work, but I'll give an example anyway. A2 = string.gsub(A2, "%s+", "") -- delete all spaces for A2 if(string.len(A2) > 0) then --if A2 is greater than 0 characters -- codes here end you can only use this in variables where you use guiComboBoxGeItemText function
-
try using string.len and string.gsub local text = "" -- empty text text = string.gsub(text, "%s+", "") -- delete all spaces if(string.len(text) > 0) then --if text is greater than 0 characters -- codes here end
-
yes now the problem is really solved thanks tut
-
I am using the hero dff exporter with max 2009 version
-
hello, I painted this object with vertex painting, but when the players walk on this object and take a jetpack, the light changes, and it also changes at different camera angles. What is the reason for this?
-
you can use a table for this, when you bring back the player's health, you mark it as true in this table, you change it to false when it spawns again so it only uses knocked down players setPlayerKnockDown(player, true) --mark the player as knocked down so he can use the command local isPlayersKnockDown = {} function setPlayerKnockDown(player, condition) isPlayersKnockDown[player] = condition end function revivir(source) if (si==1) and (cancelText==nil) then if(isPlayersKnockDown[source]) then -- only downed players can use spawnPlayer(source, 2041.3568115234,-1409.2247314453,17.1640625,178) si = 0 takePlayerMoney(source, 1000) takeAllWeapons(source) outputChatBox("...", source, 0, 255, 0) setPlayerKnockDown(source, false) --set false when the player spawns so he can't use it again end end end addCommandHandler("test", revivir) addEventHandler("onPlayerQuit", root, function() isPlayersKnockDown[source] = nil -- clean from memory end )
-
give the source player to the timer like this function revivir1() revivir = 1 cancelText = nil setPedAnimation(source, ".", ".", -1, false, false, false, true) outputChatBox (".", source, 255, 0, 0) setTimer(function(source) -- Pass source player into timer si = 1 cancelText = cancelText if (cancelText==nil) then outputChatBox(".", source, 255, 0, 0) ------This is the wrong text end end, 600, 1, source) -- Pass source player into timer end addEvent("sistemarev", true) addEventHandler("sistemarev", root, revivir1)
-
it worked, thanks ? i think, considering the size of the facility, 300 units seem to be enough
-
here thePlayer argument is invalid use for loop to add all players addEventHandler("onResourceStart", resourceRoot, function() for _,thePlayer in ipairs(getElementsByType("player")) do bindKey(thePlayer, "space", "down", pararAnim) end end ) function prueba(thePlayer) setPedAnimation(thePlayer, "finale", "fin_let_go", -1, false, false, false, false) end addCommandHandler("prueba", prueba) function pararAnim(thePlayer, key, keyState) setPedAnimation(thePlayer) end if you want to add for single player you can put it inside prueba command i don't know how to use it
-
how do you use it can you show more?
-
Hello, I am modeling a facility. I have a problem with the model that appears here. The object becomes invisible because it is a little big, how do I solve this problem, thanks size of the object
-
you can debug it with outputDebugString to find out outputDebugString(Hungers) outputDebugString(Thirsts)
-
change with result if result and #result > 0 then return end
-
There is actually no player parameter here, can you edit both places like this? addEvent("unload_vehicles",true) local function unload_vehicles(player, veh) setElementFrozen(veh,true) toggleControl(player,"enter_exit",false) setTimer(function(player,veh) local cars = getAttachedElements(veh) for i,v in pairs(cars) do destroyElement(v) end setElementData(veh,"loaded",false) --exports.global:giveMoney(plr,1500) givePlayerMoney(player, 1500) outputChatBox("قدت السيارات وحصلت على 1.500 دولار , يمكنك الرجوع واخذ مهمه جديده",player,255,255,255,true) setElementFrozen(veh,false) toggleControl(player,"enter_exit",true) end,5000,1, player, veh) end addEventHandler("unload_vehicles",resourceRoot,unload_vehicles) local function unload_vehicles(plr,md) if plr ~= localPlayer or not md then return end if source ~= checkpoint then return end local veh = getPedOccupiedVehicle(plr) triggerServerEvent("unload_vehicles",resourceRoot,veh, plr) destroyElement(checkpoint) destroyElement(blip) checkpoint = nil blip = nil end addEventHandler("onClientMarkerHit",resourceRoot,unload_vehicles)
-
Try changing 0 to -1 for dbPoll function getpaccount (_,account) local AccName = getAccountName(account) local Setpname = setPlayerName(source,tostring(AccName)) local AccData = dbQuery(AccDatacallback(), db,"SELECT * FROM stats WHERE Account=? LIMIT 1", AccName) function AccDatacallback(AccData) local result = dbPoll( AccData, -1 ) --this end if(AccData) then if(#AccData > 0) then return end end local ID = getFreeID() local SetData = dbExec(db,"INSERT INTO stats (ID,Account) VALUES (?, ?)",ID, AccName) end addEventHandler("onPlayerLogin",root, getpaccount)
-
addEvent("unload_vehicles",true) local function unload_vehicles(veh) setElementFrozen(veh,true) toggleControl(client,"enter_exit",false) setTimer(function(plr,veh) local cars = getAttachedElements(veh) for i,v in pairs(cars) do destroyElement(v) end setElementData(veh,"loaded",false) --exports.global:giveMoney(plr,1500) givePlayerMoney(plr, 1500) outputChatBox("قدت السيارات وحصلت على 1.500 دولار , يمكنك الرجوع واخذ مهمه جديده",plr,255,255,255,true) setElementFrozen(veh,false) toggleControl(plr,"enter_exit",true) end,5000,1, plr) end addEventHandler("unload_vehicles",resourceRoot,unload_vehicles) can you change this line like this, try with normal functions
-
I don't know this error maybe you can ask someone else
-
I did not know that. You're welcome. anytime ?
-
server: function darcosas(precio) local cuenta = getPlayerAccount(source) if (cuenta) and not isGuestAccount (cuenta) then outputDebugString("You selected "..precio) end end addEvent("Dar", true) addEventHandler("Dar", getRootElement(), darcosas) client: function comprarGUI() local item = guiGridListGetSelectedItem(lista) if (item>=0)then local precio = guiGridListGetItemText(lista, guiGridListGetSelectedItem (lista), 2) local dinero = getPlayerMoney(localPlayer) if(dinero >= tonumber(precio)) then item = item + 1 cerrarGUI() triggerServerEvent("Dar", localPlayer, precio) --<----------- else outputChatBox("Test 1", 255, 0, 0) end else outputChatBox("Test 2", 255, 0, 0) can you try this code, it will output according to the column selected by the player
-
I'm not sure if you want to send the whole table but you can use events for that example: server: addEvent("sendTableToServer", true) addEventHandler("sendTableToServer", root, function(theTable) --the table we will get for i,_ in ipairs(theTable) do outputDebugString(theTable[i]) --Output: Banana Cucumber Eggplant end end ) client: local clientTable = {"Banana", "Cucumber", "Eggplant"} addCommandHandler("sendtable", function() triggerServerEvent("sendTableToServer", localPlayer, clientTable) -- send the whole table as it is end )
-
I'm not sure but can you remove LIMIT 1 for hunger? local AccData = dbPoll(dbQuery(db,"SELECT Hunger,Thirst FROM stats WHERE Account=? LIMIT 1", AccName), -1) local AccData = dbPoll(dbQuery(db,"SELECT Hunger,Thirst FROM stats WHERE Account=?", AccName), -1)
-
can you try this again what's the problem on the client side? addEventHandler ("onPlayerLogin",root,function(_,Acc) local AccName = getAccountName(Acc) local AccData = dbPoll(dbQuery(db,"SELECT Hunger,Thirst FROM stats WHERE Account=? LIMIT 1", AccName), -1) if(AccData) then if(#AccData > 0) then for _,row in ipairs(AccData) do setElementData (source,"hunger",row["Hunger"]) setElementData(source, "Thirst", row["Thirst"]) break end end end end) function loadAccountData(player) local playerAccount = getPlayerAccount(player) if(playerAccount) then if(isGuestAccount(playerAccount)) then return end end local AccName = getAccountName(playerAccount) local AccData = dbPoll(dbQuery(db,"SELECT Hunger,Thirst FROM stats WHERE Account=? LIMIT 1", AccName), -1) if(AccData) then if(#AccData > 0) then for _,row in ipairs(AccData) do setElementData (player,"hunger",row["Hunger"]) setElementData(player, "Thirst", row["Thirst"]) break end end end end function saveAccountData (player) local playerAccount = getPlayerAccount(player) if(playerAccount) then if(isGuestAccount(playerAccount)) then return end end local AccName = getAccountName(playerAccount) local Hungers = getElementData (player,"hunger") local Thirsts = getElementData (player,"Thirst") dbExec(db,"UPDATE stats SET Hunger=?, Thirst=? WHERE Account=?",Hungers, Thirsts, AccName) end addEventHandler ( 'onPlayerQuit', root, function ( ) saveAccountData(source) end ) addEventHandler( "onResourceStart", resourceRoot, function( ) for _, plr in pairs( getElementsByType("player")) do loadAccountData(plr) end end) addEventHandler ("onResourceStop", resourceRoot, function() for index,players in ipairs(getElementsByType("player")) do saveAccountData(players) end end)
-
edited code
-
can you try this addEventHandler ("onPlayerLogin",root,function(_,Acc) local AccName = getAccountName(Acc) local AccData = dbPoll(dbQuery(db,"SELECT Hunger,Thirst FROM stats WHERE Account=? LIMIT 1", AccName), -1) if(AccData) then if(#AccData > 0) then for _,row in ipairs(AccData) do setElementData (source,"hunger",row["Hunger"]) setElementData(source, "Thirst", row["Thirst"]) break end end end end) function loadAccountData(player) local playerAccount = getPlayerAccount(player) if(playerAccount) then if(isGuestAccount(playerAccount)) then return end end local AccName = getAccountName(playerAccount) local AccData = dbPoll(dbQuery(db,"SELECT Hunger,Thirst FROM stats WHERE Account=? LIMIT 1", AccName), -1) if(AccData) then if(#AccData > 0) then for _,row in ipairs(AccData) do setElementData (player,"hunger",row["Hunger"]) setElementData(player, "Thirst", row["Thirst"]) break end end end function saveAccountData (player) local playerAccount = getPlayerAccount(player) if(playerAccount) then if(isGuestAccount(playerAccount)) then return end end local AccName = getAccountName(playerAccount) local Hungers = getElementData (player,"hunger") local Thirsts = getElementData (player,"Thirst") dbExec(db,"UPDATE stats SET Hunger=?, Thirst=? WHERE Account=?",Hungers, Thirsts, AccName) end addEventHandler ( 'onPlayerQuit', root, function ( ) saveAccountData(source) end ) addEventHandler( "onResourceStart", resourceRoot, function( ) for _, plr in pairs( getElementsByType("player")) do loadAccountData(plr) end end) addEventHandler ("onResourceStop", resourceRoot, function() for index,players in ipairs(getElementsByType("player")) do saveAccountData(players) end end)
-
You can use the previous examples for this, add 2 more rows to the database and get the information with select queries. You can use the update command to change it.