-
Posts
21,935 -
Joined
-
Last visited
-
Days Won
6
Everything posted by Castillo
-
What do you mean? the message will only output to the player who used the command.
-
addEventHandler ( "onMarkerHit", topdeck, function ( thePlayer ) if ( thePlayer and getElementType ( thePlayer ) == "player" ) then local nR, nG, nB = getTeamColor ( getPlayerTeam ( thePlayer ) ) setMarkerColor ( source, nR, nG, nB, 255 ) end end )
-
In "race/race_client.lua" you can find the "Map: " text, you can "detect" it by creating a function which updates it whenever you change the next map.
-
Copy the code again.
-
-- server side: function enabled ( player ) local account = getAccountName ( getPlayerAccount ( player ) ) if ( isObjectInACLGroup ( "user.".. account,aclGetGroup ( "Admin" ) ) )then local state = ( not getElementData ( player, "godMode" ) ) outputChatBox ( "God mode is now ".. ( state and "enabled" or "disabled" ) .."", player, 255, 0, 0 ) setElementData ( player, "godMode", state ) end end addCommandHandler ( "godmode", enabled ) -- client side: addEventHandler ( "onClientPlayerDamage", localPlayer, function ( ) if ( getElementData ( source, "godMode" ) ) then cancelEvent ( ) end end )
-
As I told you in my first post, is not a complete login script tutorial, it has missing the registering and login functions, instead it checks if user and password is: "user", "apple". Every fucking I posted has examples, take a look at them.
-
That's wrong manve, you must use the team element, not the name, he can do this: setPlayerTeam ( player, getTeamFromName ( "Admins" ) )
-
https://wiki.multitheftauto.com/wiki/Int ... ng_the_GUI That tutorial gives part of the functions, not the register/login ones though. These are: getAccount addAccount logIn To set the first time login, you should set an account data: setAccountData then check with: getAccountData
-
-- client side: local sWidth, sHeight = guiGetScreenSize ( ) function motdis ( ) local motdt = guiGetText ( motdtxtbox ) triggerServerEvent ( "getdx", localPlayer, motdt ) end addEventHandler ( "onClientGUIClick", motdbut, motdis, false ) local motd = "" function rendertxt ( ) dxDrawText ( motd, sWidth * 0.456, sHeight * 0.051, sWidth * 0, sHeight * 0, tocolor ( 255, 255, 255, 195 ), 1.0, "bankgothic", "left", "top", false, false, false, true ) end addEvent ( "rendertxt", true ) addEventHandler ( "rendertxt", root, function ( motdt ) removeEventHandler ( "onClientRender", root, rendertxt ) motd = motdt addEventHandler ( "onClientRender", root, rendertxt ) end ) -- server side: function getdxtxt ( motdt ) if ( not motd ~= "" ) then for _, player in ipairs ( getElementsByType ( "player" ) ) do triggerClientEvent ( player, "rendertxt", player, motdt ) end end end addEvent ( "getdx", true ) addEventHandler ( "getdx", root, getdxtxt ) Should work.
-
Yes, it is, you can use it to check if the password is correct.
-
I already know that, but if you check the setMarkerColor required arguments, you can see that alpha is required.
-
He already knows that Teteomar, he wants to fill all the label with random numbers. @Manve: Maybe you can use this function: guiLabelGetTextExtent
-
@Teteomar: You forgot to fill the alpha argument: addEventHandler("onMarkerHit",topdeck, function( thePlayer ) if ( getElementType(thePlayer) == "player" ) then local nR, nG, nB = getTeamColor( getPlayerTeam( thePlayer ) ) setMarkerColor( source, nR, nG, nB, 255 ) end end )
-
You did not understand what he said, he wants people to give him the script to execute it via runcode resource, to make cars fly and so on. @Hernandez: You can make cars fly with this: Client side: setWorldSpecialPropertyEnabled ( "aircars", true ) Or to make them go over water: setWorldSpecialPropertyEnabled ( "hovercars", true )
-
To output a message with colors, you need to define to who you want to output it. function PRbackup ( player ) outputMessageToTeams ( "Police Dispatch: ".. getPlayerName ( player ) .." Needs Backup!", { "Police", "Staff", "Military", "SWAT" }, 0, 0, 255 ) end addCommandHandler ( "backup", PRbackup ) function PRAir ( player ) outputMessageToTeams ( "Police Dispatch: ".. getPlayerName ( player ) .." Air Support!", { "Police", "Staff", "Military", "SWAT" }, 0, 0, 255 ) end addCommandHandler ( "requestair", PRAir ) function PRMili ( player ) outputMessageToTeams ( "Police Dispatch: ".. getPlayerName ( player ) .." Military Support!", { "Police", "Staff", "Military", "SWAT" }, 0, 0, 255 ) end addCommandHandler ( "requestmilitary", PRMili ) function PRSWAT ( player, cmd ) outputMessageToTeams ( "Police Dispatch: ".. getPlayerName ( player ) .." SWAT Support!", { "Police", "Staff", "Military", "SWAT" }, 0, 0, 255 ) end addCommandHandler ( "requestswat", PRSWAT ) function outputMessageToTeams ( message, teams, r, g, b ) if ( message and teams and type ( teams ) == "table" and #teams > 0 ) then for _, player in ipairs ( getElementsByType ( "player" ) ) do for _, team in ipairs ( teams ) do if ( getPlayerTeam ( player ) == getTeamFromName ( team ) ) then outputChatBox ( message, player, r, g, b ) break end end end end end Haven't tested it.
-
function speed ( ) addEventHandler ( "onClientRender", root, getspeed ) end addEventHandler ("onClientVehicleEnter", root, speed) function wylacz ( ) removeEventHandler ( "onClientRender", root, getspeed ) end addEventHandler("onClientVehicleExit", root, wylacz) addEventHandler("onClientRender",getRootElement(), function ( ) weaponID = getPedWeapon(getLocalPlayer()) weapName = getWeaponNameFromID(weaponID) health = getElementHealth (localPlayer) dxDrawText("Player Health: "..tostring(math.floor(health+0.5)).." %",20.0,264.0,296.0,280.0,tocolor(0,255,0,255),0.5,"bankgothic","left","top",false,false,false) dxDrawText("Weapon Name: "..weapName,20.0,285.0,296.0,301.0,tocolor(0,255,0,255),0.5,"bankgothic","left","top",false,false,false) if isPedInVehicle (localPlayer) == false then return end Vname = getVehicleName(getPedOccupiedVehicle(localPlayer)) health = getElementHealth (getPedOccupiedVehicle(localPlayer)) sx, sy, sz = getElementVelocity (getPedOccupiedVehicle(localPlayer)) kmhs = math.floor(((sx^2 + sy^2 + sz^2)^(0.5))*180) dxDrawText("Vehicle Name: "..Vname,20.0,307.0,296.0,323.0,tocolor(0,255,0,255),0.5,"bankgothic","left","top",false,false,false) dxDrawText("Vehicle Health: "..tostring(math.floor(health*0.1)).." %",20.0,328.0,296.0,344.0,tocolor(0,255,0,255),0.5,"bankgothic","left","top",false,false,false) dxDrawText("Speed: "..tostring(kmhs).." Km/h",20.0,348.0,296.0,364.0,tocolor(0,255,0,255),0.5,"bankgothic","left","top",false,false,false) end ) function quitar ( ) setTimer ( function ( ) for _, component in ipairs ( { "armour", "health", "money", "clock", "weapon", "ammo", "money", "wanted", "radar" } ) do showPlayerHudComponent ( component, false ) end end ,5000, 1 ) end addEventHandler ( "onClientPlayerSpawn", localPlayer, quitar ) Lo ocultara 5 segundos despues de spawnear.
-
@Xperia: Probaste con lo que yo te dije?
-
Al mostrar el HUD que vos creaste, ahi ocultas el de GTA.
-
Porque no ocultas el HUD al mostrar el que creaste?
-
function quitar ( ) showPlayerHudComponent ( "armour", false ) showPlayerHudComponent ( "health", false ) showPlayerHudComponent ( "money", false ) showPlayerHudComponent ( "clock", false ) showPlayerHudComponent ( "weapon", false ) showPlayerHudComponent ( "ammo", false) showPlayerHudComponent ( "money", false ) showPlayerHudComponent ( "wanted", false ) showPlayerHudComponent ( "radar", true ) end addEventHandler ( "onClientPlayerSpawn", localPlayer, quitar )
-
What does that error tells you? that "mapmanager" is not running. Write in the chat: "/start mapmanager".
-
Did you try searching this same section? there are many hosting companys posted here.