Hero192
-
Posts
512 -
Joined
-
Last visited
Posts posted by Hero192
-
-
Where is myButton this kinda important and show the function this code is in.
Its just a part of code
-
Hey guys, I want to set a text to a button while the player is frozen it should setText Unfreeze if not set Freeze.
I tried that , but it doesn't works like I want, I want like when you Frozen a player in Admin Panel it shows, "Freeze" / "UnFreeze".
Can anyone give me a hand?
if (isElementFrozen(player)) then guiSetText (myButton, "Unfreeze") else guiSetText (myButton, "Freeze") end
Thanks in advance.
-
Hey how to block player's GTA SA Skin in server
Should I use this line in mtaserver.conf?
peds
and I see there're two Values: (none and peds)
I want to know which one stoping players ability to connect to the server if they're using GTA:SA skin mods.
-
Oh check the Data,
open it with NotePad and you will find everything.
Dude, do you have a server right? ok, how you see player's saved data, like weapons, money, cordinations(x,y,z).. in a panel like XAMPP.
-
Thanks for the reply, but I won't codes, I want to know how to control MySQL to see player's data ! like when you use XAMPP
-
hmmmmm
try to use this:
addEventHandler("onPlayerConnect", getRootElement(), function () cancelEvent(true, "Welcome to my server") end end
lol it's the same as iLol's code just changed the text and made an espace to end
-
I'm using dbConnect, dbPoll, dbExec, dbQuery ...
https://wiki.multitheftauto.com/wiki/DbConnect
https://wiki.multitheftauto.com/wiki/DbPoll
Yes bonus I know how to Script with SQL language and use it in MTA but, I want to know how to control MySQL to my server? to see player's data
-
I think MySQL. i personally use it in my server
How you control MySQL in your server?
-
Hey all,I just want to know which type of saving fine fit to be used in a server saving's datas,
MySQL system , SQLite or XML ?
-
Thanks alot I apreciate that,
One more thing, I want to know when should I use Break and While I read that in lua website but I didn't understand it well
-
Hello dear scripters,
Today I want to know when should we use root or getRootElement() and when should we use source in trigger(Server/Client) Event and in addEventHandler
For example, I see in codes sometime: they use root and sometime they use source or localPlayer
addEventHandler ( "onClientPlayerChangeNick", getRootElement(),funcName)--This with root element why?
addEventHandler ( "onClientPlayerChangeNick", getLocalPlayer(),funcName)--and this with localPlayer
Thanks in advance.
-
Thank you for the clear informations & for your examples.
By the way,
I start doing a login system I want to store password in should I use the value as TEXT or INTEGER?
because as you know, Passwords can't be controlled it can be numbers and words in same time
dbExec (connection, "CREATE TABLE IF NOT EXISTS data (account TEXT, password TEXT)" )
Thanks in advance.
-
Hey all,
can anyone explain to me when should I use UPDATE and when should I use INSERT ?
-
Still the same problem
Help me please
-
Arm@y's code doesn't works, It keep doing the same!
Wait make me understand you want the animation to be doubled, Or...?No,I want when cop shoot the wanted player the old timer must be removed and make new timer again.
Because when cop shoot wanted twice time , the animation plays for double timer, and I won't that.
for example: 3000Ms + 3000Ms: on each twice shoot
So it's kinda annoying,
-
still one more problem, It's when I tase someone and the time still running,Like shooting him twice time.
The animation be doubled I mean the old timer + new timer and If another player tased again it keep adding the timer up
like on each time the time keep adding up .
So can you help me please
local tazerTimers = {} addEventHandler("onPlayerDamage", getRootElement(), function (attacker, weapon, _, loss) if (isElement(attacker) and getElementType(attacker) == "player" and weapon and attacker ~= source) then if ( not getPlayerTeam(attacker) ) then return end if ( getPlayerWantedLevel(source) == 0 ) then return end if ( getPlayerWantedLevel(source) >= 1 ) then if (weapon and weapon == 23) then if isTimer(tazerTimers[source]) then killTimer(tazerTimers[source]) end if (getPlayerTeam(attacker) and lawTeam[getTeamName(getPlayerTeam(attacker))]) then toggleAllControls ( source, false ) setPedAnimation(source, "ped", "KO_shot_stom") triggerClientEvent(root,"onStartTaserSound",root,attacker) tazerTimers[source] = setTimer(function(player) if ( isElement ( player ) ) then if isTimer(tazerTimers[player]) then killTimer(tazerTimers[player]) end setPedAnimation(player) toggleAllControls(player,true) end end,2500,1,source) triggerClientEvent (root, "destroySound", root) end end end end end)
-
Not working, anyone?
-
I didnt understand you well, can you do what you said by editing my code to let me know what i did wrong exactly
And thanks for your reply
-
Anyone can give me a hand?
-
Hello community,
I made a tazer system with some guides of a guy that I know
but I found a problem,when I shoot 2 shoots on the wanted before the timer of animation end the sound keep playing no stop.
Please I want it stop in same time that animation stops and how to avoid that bug?
thanks in advance.
--Client side:
local taserSound = {} local client = getLocalPlayer() function onTaserSoundPlay(attacker) taserSound[client] = playSound("taser/Fire.wav",true) if taserSound[client] and isElement(taserSound[client]) then setSoundVolume(taserSound[client], 1.0) end end addEvent("onStartTaserSound", true) addEventHandler("onStartTaserSound", root, onTaserSoundPlay) addEvent ( "destroySound", true ) addEventHandler ( "destroySound", root, function () if isElement(taserSound[client]) then destroyElement(taserSound[client]) end end)
--Server side:
local tazerTimers = {} local lawTeam = {["Police"]=true, ["SWAT"]=true, ["AirForce"] = true} addEventHandler("onPlayerDamage", getRootElement(), function (attacker, weapon, _, loss) if (isElement(attacker) and getElementType(attacker) == "player" and weapon and attacker ~= source) then if (getPlayerTeam(attacker) and lawTeam[getTeamName(getPlayerTeam(attacker))]) then local wanted = getPlayerWantedLevel(source) if (wanted > 0) then if (weapon and weapon == 23) then if isTimer(tazerTimers[source]) then killTimer(tazerTimers[source]) end setPedAnimation(source, "ped", "KO_shot_stom") setElementHealth(source,(getElementHealth(source) + loss)) triggerClientEvent(root,"onStartTaserSound",root,attacker) tazerTimers[source] = setTimer(function(source) if isTimer(tazerTimers[source]) then killTimer(tazerTimers[source]) end setPedAnimation(source) triggerClientEvent (root, "destroySound", root) toggleAllControls(source,true) end,2000,1,source) end end end end end)
-
Anyone please!? I need it urgence
-
Im sorry i didnt understand what u mean ..
Listen, I agree with using toggelControl function but when I use it, I set a Timer to the shooter and When the timer ends the player can't shoot again normaly, He need to "RELOAD" the weapon by pressing "R" key to shoot.
And it's kinda annoying I want it to shoot after the timer ends without any reload..
-
Yes, but I already explained to solidsnake that this function "toggleControl" "fire", force the player to reload after the end of the timer.
and he recommend me to edit this reload resource which it in my server,
If you know how please help me
function forceReload(player) reloadPedWeapon (player) end addCommandHandler("Reload weapon",forceReload) function bindPlayerReloadKey(player) bindKey(player,"r","down","Reload weapon") end function bindReloadForAllPlayers() for index, player in ipairs(getElementsByType("player")) do bindPlayerReloadKey(player) end end addEvent("onPlayerReload",true) addEventHandler("onPlayerReload",getRootElement(), function() reloadPedWeapon (source) end)
-
You need to to disable the silencer weapon ? only?
Yeah !
guiSetText problem
in Scripting
Posted