-
Posts
2,973 -
Joined
-
Last visited
-
Days Won
3
Everything posted by 50p
-
Did you even read my post? People get so lazy these days. @Razor, Your code is wrong.
-
guiMyCwindow is never called. Line 26: addEventHandler( "onClientResourceStart", resourceRoot, guiMyCwindow);
-
You can set it to 100-1000 (so yes, you can set it to 1 sec). In the past you couldn't sync the camera at all (getCameraMatrix server-side used to return last values set by setCameraMatrix) but now server knows about "current" player's camera position and target.
-
@EvoGT, We can help you with scripting but we can't create the script for you. You need to learn Lua first and then you can start scripting. If you can't learn then how do you expect us to help you? By creating the ready script for you? This way you will not learn. There are many script out there already which you can learn from. Everyone has to start somewhere. If you'll learn the basics you will learn more quickly how to make your own scripts. Also, check my resources (link in signature), I have created some basic scripts which can help you learn. Weapons are supported by attachElements and you can attach weapons to vehicles but you can only manipulate weapons on client-side only. If you change the weapon state for one client then it will only be changed for this client (other clients don't even know that you created a weapon for yourself). When you create a weapon for 1 client then you have to create it for everyone. When you change weapon's state for 1 player, make sure you change it for everyone. If you change it for 1 client only and if another vehicle explodes then it will only explode your that 1 player. Even the other player sitting in that vehicle will be alive and "driving wrecked vehicle" (that's what player who shot will see on their screen). You have to sync weapons yourself.
-
You showed getPlayerWantedLevel which is not setPlayerWantedLevel... Why did you change my code? If you don't modify setPlayerWantedLevel the way I did it, you will NOT change player's data, therefore client-side getElementData will return false. If you want to show 0 instead of false simply change the the 2nd gui line to: guiGridListSetItemText ( GUIEditor_Grid[1], row, GUIEditor_Column[2], tostring( getElementData( player, "wantedLevel" ) or 0 ), false, false )
-
Can't people read? Are they so lazy? @SKIPPER, Especially you. Read my previous post. You can't use getPlayerWantedLevel in a client-side script to get remote player's wanted level... Also, read wiki if unsure. @TheIceman1, use triggerServerEvent/triggerClientEvent like you did in your last post but you have to remember that triggerServerEvent will not return the results of the event from server-side. Once you trigger server event and process all the data (get all player's wanted level in this case) then you have to send these information back to the client with a table that holds other player's wanted level. If the wanted level is set by your resource, then you can use this function: _setPlayerWantedLevel = setPlayerWantedLevel; function setPlayerWantedLevel( player, level ) setElementData( player, "wantedLevel", leve ); return _setPlayerWantedLevel( player, level ); end So whenever you use setPlayerWantedLevel function, it will call this custom function which will change player's data ("wantedLevel") to whatever level you set. This way you can use the data in client-side script like this: function setplayers () for id, player in ipairs(getElementsByType("player")) do local row = guiGridListAddRow ( GUIEditor_Grid[1] ) guiGridListSetItemText ( GUIEditor_Grid[1], row, GUIEditor_Column[1], getPlayerName( player ), false, false ) guiGridListSetItemText ( GUIEditor_Grid[1], row, GUIEditor_Column[2], tostring( getElementData( player, "wantedLevel" ) ), false, false ) end end addEventHandler ( "onClientResourceStart", resourceRoot, setplayers )
-
Please, use events. Doesn't matter if it's simple script or you need to process more action when starting resource. Events are there to be used and onClientResourceStart is one of them. I don't know why gui editor doesn't put all the gui creation in one onClientResourceStart. SKIPPER's code will add players to the grid list ONLY if YOUR (local player) wanted level higher than 0. If that's what you want you can use his code, otherwise you need to communicate with the server/client ((triggerServerEvent and triggerClientEvent) if you want to get all players' wanted level so that you can use it in grid list.
-
He may have another resource running that fades the screen back to black. If he doesn't then the resource hasn't loaded before it can be started. In the server console (or in-game console looged in as admin) type "info race" this should give you some information about the resource. It will tell you a state of the resource whether it's running/loaded/failed to load,etc. If he uploaded the resource and his server was running already then he needs to use "refresh" command so that server can load the newly uploaded resource and then he should be able to start it. I think I gave you all the possible reasons why it may happen.
-
OK, How i can i fix that ? You can't. Simply open the file from the resource explorer. Like I said in my early posts, I didn't want to highlight all MTA functions in any .lua files, just the resource files. You may have a .lua script from different game which doesn't have these functions. For instance CryENGINE uses .lua scripts but doesn't have the same functions as MTA. I guess I'll have to add an option for the user whether he wants to highlight MTA functions in "external" files or not. I'm working on it, since I've had a report that resource explorer doesn't have any resources loaded. This is caused by wrong paths extracted from the Windows registry. I'll add an option for user to decide whether he wants to scan the registry to find the latest MTA installed or pick a custom MTA Server folder. For the next release I've already added: added: "File -> New -> Resource" will now open a window where user can input the most important info (author, version, etc.) to create a new resource
-
https://wiki.multitheftauto.com/wiki/SetWeaponProperty Read entire page and search the forum before you ask the question! Similar question come up almost every day. One server creates something, everyone comes here to ask how to make it.
-
I guess you don't read what people tell you. There is only 1 function that will change weapon's properties and it's setWeaponProperty. If you want the property to be changeable depending on its target then you will have to getPedTarget and check if it's specific type of element (or you can use onPlayerTarget) and then change player's weapon skill level. setWeaponProperty will change weapon's property for all players, if you change it client-side it may cause trouble for other players, so this is why you should change weapon's property for specific level and then change player's level depending on what he's aiming at.
-
Thanks for the comments. I hope you like it and doesn't crash for anyone! Well, I haven't had a single crash report yet. #The_Pain, It must be only you. Unless you opened a file from within Windows explorer, in this case none of MTA functions are highlighted. BTW, can you please stop using white color font? It's difficult to read, thank you.
-
@ZL|LuCaS, Speak English in the English forums. @Sex*, You can check my drift resource. I used dxText lib and it supports custom fonts. Just the the textlib.lua from there. https://community.multitheftauto.com/ind ... ls&id=5078
-
If you have reached 200 lines of code that worked then what is so hard that stops you from fixing it? If you want help privately then you have to PM. Why create topic where you need help if you don't want help from anyone but 1 specific person? Just PM him.
-
You can have weapon ID assigned to skin ID local weaponIDBySkin = { [287] = 31, -- skin ID 287 will have weapon 31 [286] = 31, [285] = 22 } addEventHandler( "onPlayerSpawn", root, function( ) local playerSkin = getElementModel( source ); if( skins[ playerSkin ] ) then -- check if playerSkin is inside the table giveWeapon( source, weaponIDBySkin[ playerSkin ], 100 ); end end )
-
I only help in public. If you want you can post your script here. Keep that in mind that if you have very long code then you're most likely editing someone's script, in that case you should learn from making mistakes by trial and error.
-
Do you even spawn? Have you updated your code?
-
I think you should PM him if this is personal message.
-
Maybe this is what you want... addEventHandler( "onPlayerSpawn", root, function( ) local playerSkin = getElementModel( source ); if( playerSkin == 287 ) then giveWeapon( source, 31, 100 ); elseif( playerSkin == 286 ) then giveWeapon( source, 22, 100 ); end end )
-
So here it is. Finally I got my head around some annoying problem I was encountering, anyway I got it fixed and is ready to see public. This is the first release to use installer. Enjoy! As always, please report any bugs you find. Thanks.
-
You should know how if/elseif statements work. If 1 statement is correct then it skips others but if the first one is not true then it goes to the next one, if the next one is true then it skips others... So it is obvious that it will only work with 1 and it will be the one that is true. Use "if" instead of "elseif" if you want all of them to be independent.
-
You can't use functions this way. The exported functions must be simply defined as regular functions. function showLoginBar() if guiGetVisible(ucp.loginBar) == false then guiSetVisible(ucp.loginBar, true) else guiSetVisible(ucp.loginBar, false) end end
-
I will get in touch with you via PM. I would like to test it in different environments (variety of operating systems Windows XP, 7, or .NET frameworks). The installer will detect if the user has .NET 3.5 installed anyway but I'd like to get feedback from people using different OSes. Anyone interested please let me know via PM.
-
You could replace smoke texture with 1x1 transparent texture.