Anubhav
Members-
Posts
2,277 -
Joined
-
Last visited
Everything posted by Anubhav
-
Checkout the nametag script at community. You will know.
-
Try adding a output for it. If it works then maybe its working.
-
You must use https://wiki.multitheftauto.com/wiki/SetPedControlState for it. EDIT: For shooting : https://wiki.multitheftauto.com/wiki/SetPedAimTarget
-
local swat = { } Teame = createTeam("SWAT", 0, 0, 100) CT = { [Teame] = true } CV = { [596] = true } function crear() Policia = createPed ( 285, 1288.12341, -1642.04602, 13.54688, 270, true ) createBlip ( 1288.12341, -1642.04602, 13.54688, 30, 2, 0, 0, 255, 255 ) Marcador = createMarker ( 1288.12341, -1642.04602, 12.54688, "cylinder", 1.0, 0, 0, 255, 255 ) end addEventHandler ( "onResourceStart", getRootElement(), crear ) -------------------------------------------------------------- function aceptarr (hitElement) local team = getTeamFromName ( "SWAT" ) if team then setPlayerTeam ( source, team ) setPlayerNametagColor ( source, 0, 0, 100 ) setElementModel (source, 285) giveWeapon ( source, 23, 10000 ) giveWeapon ( source, 3, 1 ) giveWeapon ( source, 31, 500 ) giveWeapon ( source, 34, 200 ) giveWeapon ( source, 41, 5000 ) giveWeapon ( source, 46, 1 ) end end addEvent( "onGreeting", true ) addEventHandler( "onGreeting", root, aceptarr ) -------------------------------------------------------------- function cerrarr (hitElement) end addEvent( "onGreetinA", true ) addEventHandler( "onGreetinA", root, cerrarr ) -------------------------------------------------------------- function invite(command,source,invite) local invite = getPlayerFromName(invite) if not invite then return else table.insert(swat,invite) outputChatBox("You are in a SWAT Team.",invite,0,0,255) outputChatBox("You added"..invite.."in swat team.",source,0,0,255) setElementData(invite,"swat",invite) if getElementData(invite,"swat") then outputChatBox("He's already in SWAT!",source,0,0,255) outputChatBox("If you want to remove him so use /remove PLAYERNAME",source,0,0,255) end end end addCommandHandler("invite",invite) -------------------------------------------------------------- function remove(command,source,remove) local remove = getPlayerFromName(remove) local data = getElementData(remove,"swat") if not data and remove then outputChatBox("The player is not in the SWAT Team!!!",source,0,0,255) return else removeElementData(remove,"swat") outputChatBox("You kicked"..remove.."from SWAT Team!",source,0,0,255) outputChatBox("You have been kicked from SWAT Team!!",remove,0,0,255) table.remove(swat,remove) end end addCommandHandler("remove",remove) -------------------------------------------------------------- Use /remove PlayerName to remove a player from SWAT. Or use /invite PlayerName to add a player to SWAT. Only for SWAT players!!
-
function guiOpen() if (guiGetVisible(YOURGUI) == true) then --Check whether gui is visible or not guiSetVisible(YOURGUI, false) --if visible then close it showCursor(false) else guiSetVisible(YOURGUI, true) --if not open it showCursor(true) end end bindKey("F2", "down", guiOpen) --bind F2 for that function Maybe this is better. He din't added the cursor which is important.
-
Type the errors.
-
Server: function nameOfFunc () local localPlayerName = getPlayerName(getLocalPlayer()) guiSetText(Nickname, localPlayerName) guiSetText(TotalEXP, getElementData(localPlayer,"EXP")) guiSetText(Level, getElementData(localPlayer,"Level")) guiSetText(Clan,localPlayerName) guiSetText(BankMoney, getElementData(localPlayer,"Bank")) end end setTimer(nameOfFunc,1000,0) Use setTimer . ITS Easy. Remember if you edit the function name edit setTimer function also. It will update every one secon.
-
Try using givePlayerMoney instead of setPlayerMoney
-
/debugscript 3 Any errors?
-
Click on setAccountData. You'll need to create savers. Find at community. There are many examples
-
https://wiki.multitheftauto.com/wiki/SetSoundMaxDistance This what you need i think.
-
function buyMap(player, command, ...) local account = getPlayerAccount(thePlayer) if not (isGuestAccount(account)) then return local playerCash = getPlayerMoney(source) if g_ForcedNextMap then outputChatBox( "* Next map is " .. getMapName( g_ForcedNextMap ), player ) return end local query = #{...}>0 and table.concat({...},' ') or nil if not query then if g_ForcedNextMap then outputChatBox( "* Next map is " .. getMapName( g_ForcedNextMap ), player ) else outputChatBox( "* Next map is not set", player, 255, 255, 255 ) end return end local map = findMap(query) if not map then outputChatBox(errormsg, player) return end if ( playerCash ) and ( playerCash >= 1000 ) then if lastmap_B == map then outputChatBox( "* That map has been played recently.", player, 255, 255, 255 ) else g_ForcedNextMap = map outputChatBox(getPlayerName(player).. " bought next map to be " ..getMapName(g_ForcedNextMap).. "", g_Root, 255, 255, 255) takePlayerMoney(source,1000) addStat(account,"buyedMaps",1) lastmap_B = g_ForcedNextMap end else outputChatBox("* You need more cash", player, 255, 255, 255) end end end addCommandHandler('bm', buyMap) addCommandHandler('buymap', buyMap)
-
botshara's script will not work. It has some spelling mistakes.
-
I think he is trying to say that he gone to another server (different scoreboard) and when he came back his old scoreboard was not thier the another servers was thier which he visited.
-
FaDyJo in your seconds example why to get player name? I think you should use getTeamName instead of it.
-
isPedInVehicle i think this function you need.
-
It happend to me to. Your acl must have got empty. Search the acl.xml for mta sa at google and get the code and paste it in your acl.xml
-
Whats wrong in this code? Any errors?
-
After i said. Btw nvm it.@
-
function onClickSend() local editmsg = tostring( guiGetText( GUIEditor.edit[1] ) ) local playerName = getPlayerName( localPlayer ) local row = guiGridListAddRow ( GUIEditor.gridlist[1] ) guiGridListSetItemText ( GUIEditor.gridlist[1], row, 2, editmsg, false, false ) guiGridListSetItemText ( GUIEditor.gridlist[1], row, 1, playerName , false, false ) triggerServerEvent("onPlayerChatMessage",localPlayer,editText,Log) guiSetText ( GUIEditor.edit[1] , "" ) end end end addEvent( "Sendmsg", true ) addEventHandler( "Sendmsg", getRootElement(), onClickSend ) Server addEvent("onPlayerChatMessage",true) addEventHandler("onPlayerChatMessage",root,function ( Text , Log ,text,player) triggerClientEvent("Sendmsg",source,text) if text and player then local log = fileOpen("Logs/support.log") or fileCreate("Logs/support.log") -- if log then fileSetPos(log,fileGetSize(log)) fileWrite(log,"\r\n",""..player.." | "..text.."") fileFlush(log) fileClose(log) end end end ) EDIT: I have corrected some mistakes. Not do the outputing.
-
LOoooool!! Did you read outputChatBox client arguments? addEventHandler("onClientVehicleDamage", root, function (attacker, weapon, loss, x, y, z, tyre) local veh = getVehicleController ( source ) or source for _, v in ipairs( getElementsByType ( "player" ) ) do if getElementData ( v, "adminism") == "Admin" then outputChatBox ( getPlayerName ( attacker ).." has punched ".. getPlayerName ( veh ).."'s Vehicle", 255, 255, 0, false ) -- Only admins will see this end end end )
-
addCommandHandler( "afk", function( player ) setElementPosition( player, 1904.8403320313, 717.12438964844, 49.214366912842 ) setElementFrozen ( player , true ) outputChatBox( "You are now in Afk zone", player, 0, 255, 0 ) end ) ) It will freeze him. And he can't shoot . He can only move the camera afaik.
-
Whats wrong in it?