itHyperoX
Members-
Posts
522 -
Joined
-
Last visited
-
Days Won
1
Everything posted by itHyperoX
-
Hi. I made a script, player can change hes walking styles. But when i'm alt +tabing, and heading back to MTA, the player again run. What can i do? Here is the code. addEvent("swatWalking",true) addEventHandler("swatWalking",root, function() outputChatBox("#FFFFFFYou changed your walking style to #D75959'SWAT'.",source,255,255,255,true) setPedWalkingStyle(source, 118) setElementData(source,"account:WalkingStyle",118) if getElementData(source,"walking") == true then setControlState(source,"walk",true) end end)
-
client tabla = { -- YourPNGName Textura name {"YourPNGName", "prolaps01"}, {"YourPNGName", "heat_01"} } addEventHandler( "onClientResourceStart", resourceRoot, function() for i = 1, #tabla do local shader, tec = dxCreateShader ( "texreplace.fx" ) local tex = dxCreateTexture ( "files/"..tabla[i][1]..".png" ) engineApplyShaderToWorldTexture ( shader, tabla[i][2] ) engineApplyShaderToWorldTexture ( shader, tabla[i][2].."lod" ) dxSetShaderValue ( shader, "gTexture", tex ) end end) texreplace.fx texture gTexture; technique TexReplace { pass P0 { Texture[0] = gTexture; } } meta: <meta> <script src="sourceC.lua" type="client"></script> <file src="texreplace.fx"></file> <!-- Files --> <file src="YourPNGName.png"/> </meta>
-
replace with mine. Thats 100% works.
-
addEventHandler("onPlayerSpawn",root,function () local account = getPlayerAccount(source) if (account) and not (isGuestAccount(account)) then local weapons = getAccountData(account, "weapns") if (weapons) and (fromJSON(weapons)) then takeAllWeapons(source) for weapon, ammo in pairs(fromJSON(weapons)) do giveWeapon(source, weapon, ammo, true) end end end end) addEventHandler("onPlayerWasted",root,function () local account = getPlayerAccount(source) if (account) and not (isGuestAccount(account)) then local weapons = getAllPedWeapon(source) setAccountData(account, "weapns", toJSON(weapons)) end end) function getAllPedWeapon(thePed) local weapons = { } for slot=1, 12 do local weapon = getPedWeapon(thePed, slot) local ammo = getPedTotalAmmo(thePed, slot) if (weapon > 0) and (ammo > 0) then weapons[weapon] = ammo end end return weapons end
-
i i just realised too. Sorry for this little problem ^.^. Thanks.
-
Line 9 attempt to perform arthmetic on boolean value setTimer(function() if (getElementData(localPlayer,"pLevel") or 0) then setElementData(localPlayer,"pLevel",getElementData(localPlayer,"pLevel") + 1) --- Line 9 outputChatBox(getElementData(localPlayer,"pLevel")) end end, 100, 0)
-
LOL, now that broke what worked. client: setTimer(function() if getElementData(localPlayer,"pLevel" or 0) then setElementData(localPlayer,"pLevel",getElementData(localPlayer,"pLevel") + 1) outputChatBox(getElementData(localPlayer,"pLevel")) end end, 100, 0) I dont get anything from this. Whats happened with this? No debug error
-
Hi, im trying to create my own level system, but i got some problem. I tried a few way, but always gettint debug errors and i dont know how to fix that. Debug error: sourceS: Line 8: attempt to compare boolean with number Here is the server side: exports.scoreboard:scoreboardAddColumn("Level") function setPlayerLEVEL(player) for _,player in ipairs(getElementsByType("player")) do local currentPlayerLevel = getElementData(player,"pLevel" or 0) if currentPlayerLevel < 5 then --- Line 8 setElementData(player,"Level",2) end if currentPlayerLevel >= 10 and currentPlayerLevel < 15 then setElementData(player,"Level",3) end if currentPlayerLevel >= 20 and currentPlayerLevel < 30 then setElementData(player,"Level",4) end if currentPlayerLevel >= 30 and currentPlayerLevel < 40 then setElementData(player,"Level",5) end end end setTimer(setPlayerLEVEL,500,0) Here is the client side: setTimer(function() if getElementData(localPlayer,"pLevel" or 0) then setElementData(localPlayer,"pLevel",getElementData(localPlayer,"pLevel") + 1) end end, 10*600, 0) Thanks any help. Or can i make it easier?
-
try this addEventHandler("onElementDataChange",getRootElement(), function (dataName,oldValue) if getElementType(source) == "player" then if dataName == "points" then for k, v in ipairs(getElementsByType("player")) do setElementData(player,"Rank","Novice") elseif getdatax >= 10000 then setElementData(player,"Rank","Rookie") elseif getdatax >= 100000 then setElementData(player,"Rank","Active") elseif getdatax >= 1000000 then setElementData(player,"Rank","Scholar") elseif getdatax >= 10000000 then setElementData(player,"Rank","Master") end end end)
-
SetPedCameraRotation maybe
-
fixed, rewrited the vehicle creating handler
-
Can you give me please a little help about this please?
-
but when i'm buy the car which is dont have custom name i dont get error. The problem is there i think
-
when i'm trying to buy the "KatonaiHelikopter" (Custom Named) : http://kephost.com/image/woNc When I'm buying the default named vehicle nothing error, everything work. 100% the problem is in the custom vehicle names.
-
addEvent("jarmuVetel1",true) addEventHandler("jarmuVetel1",getRootElement(), function(id,cost,name) if (exports.serverExport:getMoney(source)>= tonumber(cost)) then local account = getPlayerAccount(source) local name = getAccountName(account) local playercar = executeSQLQuery("SELECT vehID FROM jarmuslot1 WHERE AccNAME = ?",name) if #playercar > 0 then outputChatBox("#CA5454[Jármű - Rendszer]#FFFFFF Ezen a sloton már van járműved. (1)",source,255,255,255,true) else exports.serverExport:takeMoney(source,tonumber(cost)) local addVehicle = executeSQLQuery("INSERT INTO jarmuslot1 (AccNAME,vehID,vehiclePRICE) VALUES(?,?,?)", tostring(name), tonumber(id), tonumber(cost), " ", " ", " ") -- Line 51 ERRORMSG if addVehicle then outputChatBox("#6F9F86[Jármű - Rendszer]#FFFFFF Sikeresen megvetted a kiválasztott járművet.",source,255,255,255,true) else outputChatBox("#CA5454[Jármű - Rendszer]#FFFFFF Sikertelen jármű vásárlás.",source,255,255,255,true) end end else outputChatBox("#CA5454[Jármű - Rendszer]#FFFFFF Nincs elég pénzed hogy megvedd ezt a járművet.",source,255,255,255,true) end end) When im buy the car which dont have custom name, i dont get any error. Errors only appear when i'm trying to buy a "custom named" car. I think the problem is the vehicle custom name
-
@NeXuS™ edit: when i'm buying car it saying : ERROR: Database query failed: no such column: Sad When i'm buying the car which is dont have custom name, thats work. Only getting error when trying to buy "custom" named vehicle I tried after the error with the default names, and no debug error. What can be the problem?
-
bad argument #1 to 'ipairs' (table expected, got nil)
-
ocal biks = { {411,80000}, {455,5000}, {597,10000}, {462,35000}, {521,115000}, {463,95000}, {510,14000}, {522,175000}, {461,100000}, {448,50000}, {468,95000}, {586,95000} } local carNames = { [411] = "Ferrari", [455] = "BMW M4", [597] = "Test" } function getVehicleRealName(vehicle) if vehicle then local vehicleModel = tonumber(getElementModel(vehicle)) if carNames[vehicleModel] then return carNames[vehicleModel] else return getVehicleNameFromModel(vehicleModel) end end end for i,v in ipairs(biks) do local bikName = getVehicleRealName(v[1]) local row = guiGridListAddRow(bikglVehicleSelection) guiGridListSetItemText(bikglVehicleSelection,row,1,bikName,false,true) guiGridListSetItemText(bikglVehicleSelection,row,2,tostring(v[2]),false,true) end Here is, i getting so many debug error From the "carNames" starting the "custom" car names, and i want that, if the vehicle have custom name, it showing the "custom" name, not the default. I hope you understand
-
@NeXuS™ Just Showing the default vehicle names not the "custom" names. But no debug
-
Hi. I'm working on my own vehicle shop, and in the end, i got some problems. Here is the code local vehicles = { {411,80000}, {509,5000}, {481,10000}, {462,35000}, {521,115000}, {463,95000}, {510,14000}, {522,175000}, {461,100000}, {448,50000}, {468,95000}, {586,95000} } local carNames = { [500] = "Dozer", [455] = "BMW M4", [597] = "Test" } function getVehicleRealName(vehicle) if vehicle then local vehicleModel = getElementModel(vehicle) if carNames[vehicleModel] then return carNames[vehicleModel] else return getVehicleNameFromModel(v[1]) end end end for i,v in ipairs(vehicles) do local row = guiGridListAddRow(bikglVehicleSelection) guiGridListSetItemText(bikglVehicleSelection,row,1,getVehicleRealName(tostring(v[1])),false,true) -- Here is the error guiGridListSetItemText(bikglVehicleSelection,row,2,tostring(v[2]),false,true) end The problem is, the gui not showing the vehicles real name. I got some debug error, tried to fix, but nothing helped me. debug: Bad argmunet @ 'getElementModel' [Expected element at argument 1, got string '411'] attemt to index global 'v' (nil value) any help please? When i'm using normal vehiclenames, everything work. Here is the default local vehicles = { {411,80000}, {509,5000}, {481,10000}, {462,35000}, {521,115000}, {463,95000}, {510,14000}, {522,175000}, {461,100000}, {448,50000}, {468,95000}, {586,95000} } for i,v in ipairs(vehicles) do local bikName = getVehicleNameFromModel(v[1]) local row = guiGridListAddRow(bikglVehicleSelection) guiGridListSetItemText(bikglVehicleSelection,row,1,bikName,false,true) guiGridListSetItemText(bikglVehicleSelection,row,2,tostring(v[2]),false,true) end
-
createMarker onMarkerHit getPedOccupiedVehicle setElementHealth