
Lordy
Members-
Posts
290 -
Joined
-
Last visited
Everything posted by Lordy
-
offtopic: Shouldn't u use some gay flag or something :D.. Rainbow clan lol /offtopic
-
If you have other mods installed, expect MTA to act strangely. Try with a clean install of San Andreas. Also, the crash might be caused of the sloppy coding of a server you joined. (dp2.3 wasn't totally bugless and especially borked clientside scripts CAN crash your MTA)
-
You could use arctan for getting the angle. Something like this I guess, if I mess up, don't blame me, technically I've not learned this in school yet. (tan alpha was a/b right?) local x1, y1,_ = getElementPosition(thePlayer) local x2,y2,_ = getElementPosition(thePed) local xdist, ydist = = x1 - x2, y1 - y2 local theRot = math.atan(xdist/ydist) setPedRotation(thePed, theRot) Now if someone finds something wrong, please correct me
-
It would be great if you actually read the full article at wiki about engineLoadDFF not just the syntax part. http://development.mtasa.com/index.php? ... ineLoadDFF, third line And if you actually heeded my advice of seeing the wiki example you would have seen the need of engineReplaceModel too
-
Wiki tells about engineImportTXD: That means you need to load DFF too. See the wiki example on euros http://development.mtasa.com/index.php? ... ineLoadDFF
-
Your translator doesn't make any sense
-
I don't think that's what he wanted Gamesnert. Maybe you meant something like this? -- somewhere z_one = guiCreateButton ( ... ) z_two = guiCreateButton ( ... ) z_three = guiCreateButton ( ... ) addEventHandler("onClientGUIClick", theParentOfButtons, triggerTheEvent) -- function triggerTheEvent() local eventname, sourceroot if source == z_one then eventname = "myCustomEvent" -- it chooses what event to trigger here sourceroot = getLocalPlayer() -- and chooses what will be the source variable = "twillyg" elseif source == z_two then ...... end triggerServerEvent(eventname, sourceroot, variable) end Only change the parts that vary inside the if statements, like if you need them to activate the same event, then don't declare it inside the if clause, but put it straight into triggerserverEvent, if you get what I mean Only change things that you want to change And you can
-
Well you are making already now some serious mistakes. You call the function chnsaw, while you actually have a function installchnsaw, Then you use undefined variables chnsaw and chnsawicon later too, which are essentially nil values. And last but not least I don't think you can change the texture of anything else but a vehicle. Might be wrong though. EDIT: I see that the second post doesn't have those mistakes EDIT: And at your second post now: Wiki clearly tells two things: and at EngineReplaceModel it is said that they support changing vehicles only. So if you want to change the hud, you have to disable it and draw a new one. EDIT3: And as I can see you already have started a thread about it a bit back, why start to do it the other way now?
-
Interesting why do you pass the red colour value as a local player? Hint: clientside outputChatBox doesn't have visibleTo argument
-
Have a command, have a GUI for it, have a marker for it, how the hell should I know?
-
Try it and see?
-
2. You store in SQL the coordinates of the spawn for the account and just use them. You can store in xml too or setAccountData but I wouldn't recommend that. 3. If you don't find anything from the sql query - it means that he might not have the house and then just spawn him at some hospital coordinates. 4. Code some things for jobs. I have no idea what you want tho. But you can also use markers and trigger with them some job place. Note: I intentionally didn't give you any straight code examples since I kinda don't believe you would get any use of them. If you can't understand the code, why bother having it.
-
1. Yes it is 2. Yes it is 3. Yes it is 4. Yes it is
-
No it isn't. Last time I checked 192.168.*.** was a private network address so not an external ip. Wikipedia: RFC1918 IP-range #addresses descr. largest CIDR block host id size 24-bit block 10.0.0.0 – 10.255.255.255 16,777,216 single class A 10.0.0.0/8 (255.0.0.0) 24 bits 20-bit block 172.16.0.0 – 172.31.255.255 1,048,576 16 contiguous class Bs 172.16.0.0/12 (255.240.0.0) 20 bits 16-bit block 192.168.0.0 – 192.168.255.255 65,536 256 contiguous class Cs 192.168.0.0/16(255.255.0.0) 16 bits
-
I took a look at the resource and it seems you have a lot of code duplication. It doesn't mean it's bad, but it's just not optimised. For example instead of defining local chatRadius everywhere you could define it at start globally (or locally, but outside the function) so it could be changed easily too. Like you have this: elseif angry or angry1 then local chatRadius = 10 local chatSphere = createColSphere( posX, posY, posZ, chatRadius ) local nearbyPlayers = getElementsWithinColShape( chatSphere, "player" ) destroyElement( chatSphere ) for index, nearbyPlayer in ipairs( nearbyPlayers ) do outputChatBox( playerName.." is angry", nearbyPlayer, 200, 200, 200 ) end elseif evil then local chatRadius = 10 local chatSphere = createColSphere( posX, posY, posZ, chatRadius ) local nearbyPlayers = getElementsWithinColShape( chatSphere, "player" ) destroyElement( chatSphere ) for index, nearbyPlayer in ipairs( nearbyPlayers ) do outputChatBox( playerName.." grins evilly", nearbyPlayer, 200, 200, 200 ) end elseif fuming then local chatRadius = 10 local chatSphere = createColSphere( posX, posY, posZ, chatRadius ) local nearbyPlayers = getElementsWithinColShape( chatSphere, "player" ) destroyElement( chatSphere ) for index, nearbyPlayer in ipairs( nearbyPlayers ) do outputChatBox( playerName.." is fuming", nearbyPlayer, 200, 200, 200 ) end Could be done faster with just http://lordy.pastebin.com/d55333e66 If you can get what I mean there then you could use it, if you don't, then don't try experimenting because I know I didn't explain it too well there. But the main idea is that if you define the nearbyplayers and the radius each time it could be more meaningful to define them before the if statements and inside the if statements only set the variables that vary (hence variables). And after the ifs you can just outputChatBox(prefix..playerName..suffix..message, playerstooutput, r, g, b) and you can use it for all your types. If you want to even make a normal chat with it all you have to do is inside the elseif part just define prefix = ""; suffix = ": "; playerName=getClientName(thePlayer); playersToOutput=getRootElement() ; r,g,b = getPlayerTeamColor(thePlayer) and then still use the same outputChatBox without code duplication.. but again, if I didn't make sense, don't try to understand
-
And to explain why your code doesnt work is that canceling the vehicle damage has to be done server side, as onVehicleDamage is a server side event (and canceling it wouldn't make sense client side anyway.) You can use your code server side or use the function 50p linked to. And btw, onVehicleDamage has only one parameter exported, loss. See http://development.mtasa.com/index.php? ... icleDamage for more about it
-
Where have you heard it? I guess you should take a look at the place again where you heard it. Seriously, they don't post links to wikis for fun. And wikis are not made for fun. They are made for guys like you to read and understand them so we wouldn't have to answer the same questions all the time. If you can now find the link from this thread, get to wiki, press some random link that is labeled "Deathmatch Server Manual" on the wiki main page then you wouldn't be asking these questions and we wouldn't be wasting our time getting you to wiki.
-
Then let him ask. Because if you can't read what we write here and then try to explain it all to some other person it will be a general fail
-
Which still concludes to the need of his triggering mechanism to help him. But I'm afraid he has forgotten this thread anyway
-
In that case wiki lies perhaps.. because unless I add a check for state == "down" then it always triggers twice.. And I'm using "down" state not "up".. So I have no idea why wiki would say so edit: Can't test atm, but I'm not sure anymore was it the case with onClientClick or onClientGUIClick (have been using both lately ).. But I remember something triggering twice
-
You also don't check the button state (checked the source at GUISharedFuncs:AddOnClick and Button:Create).. I really think that he just triggering it for both mouse states up and down. But still, without his client side code I cannot tell.
-
I guess that he triggers the server side events on gui click and doesn't check for button state, so it triggers for both up and down. You need to give information about your triggering system too.. And btw, you don't need to add separate events for each vehicle, just add one event and pass the vehicle name as a string or something.
-
Quite a nice vid /me looks forward to 100% at robhol's avatar
-
you mean like a point just a percent between two points starting from first? I dunno if this would work but I'd try it first function getPoint(X, Y, Z, XX, YY, ZZ, percent) local newX = (XX - X) * percent + X local newY = (YY - Y) * percent + Y local newZ = (ZZ - Z) * percent + Z return newX, newY, newZ end Something like this? I haven't tested it but it should work Edited it a bit as you pointed to my error