Anubhav
Members-
Posts
2,277 -
Joined
-
Last visited
Everything posted by Anubhav
-
function onQuit() local acc = getPlayerAccount(source) if (acc) and not isGuestAccount(acc) then local walk = getPedWalkingStyle (source) setAccountData(acc, "wstyle", tostring(walk)) end end addEventHandler("onPlayerQuit", getRootElement(), onQuit) function onLogin(_, acc) local walk = getAccountData(acc, "wstyle") or 0 setPedWalkingStyle(source, tonumber(walk)) end addEventHandler("onPlayerLogin", getRootElement(), onLogin)
-
function onQuit() local acc = getPlayerAccount(source) if (acc) and not isGuestAccount(acc) then local walk = getPedWalkingStyle (source) setAccountData(acc, "wstyle", tostring(walk)) end end addEventHandler("onPlayerQuit", getRootElement(), onQuit) function onLogin(_, acc) local walk = getAccountData(acc, "wstyle") or 0 setPedWalkingStyle(source, tonumber(walk)) end addEventHandler("onPlayerLogin", getRootElement(), onLogin)
-
Do you even know you can name arguments of a function anything with a few exceptions? onMarkerHit gives a element and he just defined it as thePlayer, so now thePlayer holds the value that which element hit it. Yes I know thePlayer in this case means the element who hits the specify marker, but instead of doing that check he can check dirrectly if the element's type is equal to player or else. Because, by doing this check if not getElementType(thePlayer) == "vehicle" then it will clearly let the ability to other elements that might hit the marker later Did you even read my post about this? I did the check if he is player then go forward otherwise no.
-
Do you even know you can name arguments of a function anything with a few exceptions? onMarkerHit gives a element and he just defined it as thePlayer, so now thePlayer holds the value that which element hit it. Yes I know thePlayer in this case means the element who hits the specify marker, but instead of doing that check he can check dirrectly if the element's type is equal to player or else. Because, by doing this check if not getElementType(thePlayer) == "vehicle" then it will clearly let the ability to other elements that might hit the marker later Did you even read my post about this? I did the check if he is player then go forward otherwise no.
-
Better way, load everything from XML to a table. Then whenever you add things.etc do it in the table. AT THE resource stop add them into the XML file. Tables are even easier to use!
-
Better way, load everything from XML to a table. Then whenever you add things.etc do it in the table. AT THE resource stop add them into the XML file. Tables are even easier to use!
-
Do you even know you can name arguments of a function anything with a few exceptions? onMarkerHit gives a element and he just defined it as thePlayer, so now thePlayer holds the value that which element hit it.
-
Do you even know you can name arguments of a function anything with a few exceptions? onMarkerHit gives a element and he just defined it as thePlayer, so now thePlayer holds the value that which element hit it.
-
function vctint(thePlayer) if getElementType(thePlayer) == "player" then if isPedInVehicle(thePlayer) then return end setElementInterior(thePlayer, 5) setElementDimension(thePlayer, 1) setElementPosition(thePlayer, 225.0107421875, -8.0927734375, 1002.2109375) setElementRotation(thePlayer, 0, 0, 90, "default", true) setCameraTarget(thePlayer, thePlayer) end end addEventHandler("onMarkerHit", vctIn, vctint) + make sure vctIn is a marker variable. + dont go in it with a vehicle
-
function vctint(thePlayer) if getElementType(thePlayer) == "player" then if isPedInVehicle(thePlayer) then return end setElementInterior(thePlayer, 5) setElementDimension(thePlayer, 1) setElementPosition(thePlayer, 225.0107421875, -8.0927734375, 1002.2109375) setElementRotation(thePlayer, 0, 0, 90, "default", true) setCameraTarget(thePlayer, thePlayer) end end addEventHandler("onMarkerHit", vctIn, vctint) + make sure vctIn is a marker variable. + dont go in it with a vehicle
-
First of all, I'm not sure if it works. It goes like this. for i=1, guiGridListGetRowCount(wepGridlist) do end [lua] This creates a loop till the row count of your gridlist For example, if it is 5, it will loop 5 times. [lua] for i=1, guiGridListGetRowCount(wepGridlist) do local ID = guiGridListGetItemText( wepGridlist, i, 1 ) local Name = guiGridListGetItemText( wepGridlist, i, 2 ) local Ammo = guiGridListGetItemText( wepGridlist, i, 3 ) end Now here, you used guiGridListGetItemText, with your gridlist name and where is the loop as i will change everytime it loops till your row count. You get your results! GL to scripting
-
First of all, I'm not sure if it works. It goes like this. for i=1, guiGridListGetRowCount(wepGridlist) do end [lua] This creates a loop till the row count of your gridlist For example, if it is 5, it will loop 5 times. [lua] for i=1, guiGridListGetRowCount(wepGridlist) do local ID = guiGridListGetItemText( wepGridlist, i, 1 ) local Name = guiGridListGetItemText( wepGridlist, i, 2 ) local Ammo = guiGridListGetItemText( wepGridlist, i, 3 ) end Now here, you used guiGridListGetItemText, with your gridlist name and where is the loop as i will change everytime it loops till your row count. You get your results! GL to scripting
-
See my post please, also the setCameraTarget
-
See my post please, also the setCameraTarget
-
What? C++ is also one of the most complicated language, as far as I know. Lua is quite simple and we just can't put C++ like this. It will be horrifying for scripters, they will have to learn alot of things again and that also in more complicated way. Let Lua be there.
-
What? C++ is also one of the most complicated language, as far as I know. Lua is quite simple and we just can't put C++ like this. It will be horrifying for scripters, they will have to learn alot of things again and that also in more complicated way. Let Lua be there.
-
It is because the hit element is vehicle... and you are using isPedInVehicle because it's giving a vehicle. So you should use "not getElementType(player) == "vehicle" ".
-
Good way. At that time you can toggleControl for firing. And if he presses R then remove that 1 bullet.
-
Welcome. I know some languages don't have elseif, rather else if.
-
Make sure it is a resource in Admin group.
-
local consulta = dbQuery(myCallback,db,"SELECT * FROM acc_table") local resultado = dbPoll( consulta, -1 ) for _, v in ipairs(resultado) do local acc = v['account'] local playerAccount = getAccount( acc ) setAccountData(playerAccount,"Money", 1000) end
-
try this exports["notices"]:addNotification(source,"Test",255,success);
