-
Posts
184 -
Joined
-
Last visited
Everything posted by Jason_Gregory
-
You need to define a new table for PlayerMoney[source] Playermoney = {} And yes there is a easy way to aviod this... Set the Variable to nil or 0 when the Player disconnects from the server. function quitPlayer ( quitType ) Playermoney = nil end addEventHandler ( "onPlayerQuit", getRootElement(), quitPlayer )
-
Hm...not triggered for god-Children. Thx, my English fails miserable . Im still confusing i thought the Serverside Event is fired synchronistic with the Clientside Damage Event but like Gamesnerd said it makes sense
-
Allright (omfg i hate caseSensitive ), it wouldn´t be better calculating the new Players Health, Starting a Timer and Checking him after ~3/4 Second again ? local p_Health = {} function Hphack(attacker, attackerweapon, bodypart, loss) p_Health[source] = getElementHealth(source) - loss setTimer(Hphacksleep, 750, 1, source) end addEventHandler("onPlayerDamage", getRootElement (), Hphack) function Hphacksleep(playa) if(getElementHealth(playa) ~= p_Health[playa])then outputChatBox("Hacker...", playa) end end Should work
-
If I understand aright the Event (onPlayerDamage) is fired once after Damaging the Playersource and s0beit puts Health back AFTER he lost Health (the Event was fired), with something like a Timer (yeah it should have a ~1/4 Sec delay). Why not slowing down the Event with sleep ? (Im not sure about that, cause i´ve never seen the sleep for Debian) c_Seconds = 0.5 addEventHandler("onPlayerDamage", getRootElement (), function(attacker, attackerweapon, bodypart, loss) os.execute("sleep " .. tonumber(c_Seconds)) if(getElementHealth(source) > 100 or getElementHealth(source) == 100 or loss == 0)then kickPlayer ( source, "Server", "Hp-Hax0r" ) end )
-
Take a look at your kick Command... addEventHandler("OnPlayerDamage", getRootElement (), function(attacker, attackerweapon, bodypart, loss) if(getElementHealth(source) > 100 or getElementHealth(source) == 100 or loss == 0)then kickPlayer ( source, "Server", "Hp-Hax0r" ) end )
-
Does the SA-MP emulator for MTA still work
Jason_Gregory replied to Kevin_Linden's question in Client
Simply remove then. These Functions are new in 0.3, the Emulator need to be Updated. (Compiled Sa-mp Modes sucks) -
No but it would be useful for ranged Chatmessages. It looks fine, but Verdana is easily readable (and it looks epic for any Resolution) Tahoma is fine yeah, but i think it´s better setting the Dafault Font to Verdana. Lots of Players are uninformed about changing the Mta-Ingame-Font
-
Useful Functions, Commands and Code Snippets
Jason_Gregory replied to NeonBlack's topic in Scripting
*facepalm fucking smileys -
Useful Functions, Commands and Code Snippets
Jason_Gregory replied to NeonBlack's topic in Scripting
Chatcommands - Ccmd Needs to be tested - For at most 2 arguments (Yeah i think there is no need for more than 2 Arguments, most of the Commands only requires 1-2) Ccmd Table Syntax Chatcommandname, CommandHandler c_cmds = { "kick", "k_player", "ban", "b_player" } Chatchecker function c_CommandHandler( message, messageType ) local arg2 if(message == 0)then nBeginn["c_Start"], nEnd["c_End"] = string.find(message, "!") if(nBeginn["c_Start"] ~= false and nBeginn["c_Start"] == 1)then message = string.lower(message) -- for accepting chatcommands like /KIcK or /kICK if(string.len(string.sub(message, 2)) > 0)then l_pos = 1 for key, c_cmd in pairs(c_cmds), 2 do nBeginn["c_Arg"] = string.sub(message, 2, #c_cmds[l_pos]+2) -- Word Symbols arg2 = #c_cmd[l_pos]+3 -- +1 next arg tab l_pos=l_pos+2 if(nBeginn["c_Arg"] == c_cmd)then --c_cmd[l_pos+1] l_pos=l_pos-1 local c_Playa = getElementsByType( "player" ) for theKey, c_Target in ipairs(c_Playa) do nBeginn["c_Target"], nEnd["c_Target"] = string.find(message, c_Target) if(nBeginn["c_Target"] == arg2 and nEnd["c_Target"] == #getPlayerName(c_Target)+arg2)then if(c_Target ~= source)then executeCommandHandler ( c_cmds[l_pos], source, c_Target ) else return outputChatBox("* You are targeting yourself, Retard!", source) end else return outputChatBox("* Player "..string.sub(message,arg2).." not found!", source) end break -- playerloop end break -- arg1 loop else return outputChatBox("* Command !"..nBeginn["c_Arg"].." not found in tha Resource \"{SMILIES_PATH}/icon_surprised.gif\" alt=\"\" title=\"Surprised\" />", source) end end end end end end addEventHandler( "onPlayerChat", getRootElement(), c_CommandHandler) Called Handler function kickPlayerHandler ( sourcePlayer, commandname, kickedname ) local kicked = getPlayerFromNick ( kickedname ) if ( hasObjectPermissionTo ( sourcePlayer, "function.kickPlayer" ) ) then kickPlayer ( kicked, sourcePlayer ) end end addCommandHandler ( "k_player", kickPlayerHandler ) function banPlayerCommand ( sourcePlayer, commandName, bannedName ) if ( hasObjectPermissionTo ( sourcePlayer, "function.banPlayer" ) ) then local bannedPlayer = getPlayerFromNick ( bannedName ) banPlayer ( bannedPlayer, sourcePlayer ) outputChatBox ( "ban: " .. bannedName .. " successfully banned", sourcePlayer ) else outputChatBox ( "ban: You don't have enough permissions", sourcePlayer ) end end addCommandHandler ( "b_player", banPlayerCommand ) -
I got a few suggestions for the current "Chatbox". 1. The current Limit of the Chatbox is set to 40 Characters - Nickname. Example for Username 'Dolce&Gabbana': Dolce&Gabbana:Hey Guys i just want to say Hello 15 Characters + 33 Characters = 48 Characters = 2 Lines for a Small Text It would be better removing or fix the Font: Verdana (buggy when changing from Font XY to Font Verdana) and decreasing the Chatwindow Font to 60% - 80% + Increasing the Size of the Chatbox´s X Coordinate and increasing the Chatboxcharacters to 125 Symbols + adding a Rule 2 prevent Multiline Comments/Statements. Default Font should be Verdana 2. Setting the Chatbox Layout Serverside would be also great Feature since the current one looks like a blue Direct X Rectangle with somelines init. Its not necessary changing the Players config/.xml Stylesheet Configuration, just changing the Layout till he Leave the Server. Then the Layout should be set to default. 3. Alphavalue for the outputChatBox. It should be possible but i think this can wait. Greeetz Jason
-
Sure we can ban them Serial, but isnt there a Way for Mtasa just changing the Servername or Warning them for making Advertisment ? It´s fucking annoying for us...
-
Hello Mta-Team, we got a big problem since the last week. A Server is faking our -XIII- Race/DM/Fun Server and making advertisment on our own Server. Servername: [XIII] V.I.P Server ... They dont stop making advertisment since the last days. Is there a way to stop those sucker/Cheater ? Thanks -XIII- Team
-
Is there a way to make Freeroam load in City Hall by default
Jason_Gregory replied to Kevin_Linden's topic in Scripting
Dont forget to put the Player into the Interior 6. You should search your Resource for "SpawnPlayer" -
Vice City, cause it rockz. San Andreas is full of glitch Bugs and i hate the San Andreas "Ghetto" Language
-
Hm...im not sure about that, but it should be possible to port your Ped into a Train and setting his ControlState for driving forwards to true. First you put your Ped into the Created Train (Vehicle-Definition "YourTrain") with the Ped-Definition "Traindriverped". Then... setTrainDerailable( YourTrain, false) setPedControlState ( Traindriverped, "forwards", true ) After this you check if the Ped entered a Area/Gangzone (near a Station) and set the Trains Speed to 0. Or you get the Players Speed and reduce the Speed till it´s 0.
-
Jason_Gregory - Jorange_Gregory Damn my Real-Name is lame
-
Write your own application in Visual Basic... Heres a example. Public Function KillByName(ByVal Name As String) As Boolean On Error GoTo KillByName_Error Dim WMI, Process, Processes Dim Counter As Integer, RetVal As Integer Dim Found As Boolean WMI = GetObject("winmgmts://.") If (Err.Number <> 0) Then KillByName = False Exit Function End If Processes = WMI.execquery("Select * from win32_process") If (Processes.Count = 0) Then KillByName = False Exit Function End If For Each Process In Processes If (UCase(Process.Name) = UCase(Name)) Then Process.Terminate(Process.ProcessID) Found = True End If Next KillByName = Found Exit Function KillByName_Error: KillByName = False End Function Example... Private Sub YourKill_ButtonEvent(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLaunch.Click Dim myProcesses() As Process Dim instance As Process myProcesses = Process.GetProcessesByName("gtasa") For Each instance In myProcesses KillByName("gtasa.exe") Next End Sub
-
Hm... try to use onPlayerTarget and check if the Player is targeting with a Spraycan, then you check if he is pressing the "Fire" Button and then add the Picture with DxDrawImage with getElementPosition. You must figure out the Rotation of the Player and then add the .png to the Wall.
-
Ah...thanks alot Jumba Damn i forgot to set the "http" row to true <export function="function_query" http="true" /> // I dont understand what http has to do with #C but it works Thanks
-
Is there a Way to Replace Skin ID: 0´s Skin without compiling the whole Mta ?
-
Hi Community, im trying to call a exported function in my #C Project but it allways returns a curious Result... After downloading #C Software Development Kit and after importing it, i started creating some functions but yeah...it´s a bit messed My Console tells me something about the, ~i dont have authority for http. Im not able to export my function. What i need to do ?
-
I have the same Problem but i thinks it´s the Gamemonitor issue When will it be fixed ?
-
Tell us what exactly is going wrong. Stil the logIn Function ?
-
OnClientDownloadStart/OnDownloadStart Events
Jason_Gregory replied to Jason_Gregory's topic in Suggestions
Ah thats Nice Thanks for replying -
I tryed it with the House Icons the Big Marker is allright, but the Little House Marker is 50% under the Ground for me. But if it works for him....yeah, i thought getGroundPosition(x, y, z) gets the Correct Position of the Ground and not of an Spawning Player. For me it still dont work with the House Icons (Color: Blue/Green). Whatever!
