
BinSlayer1
Members-
Posts
491 -
Joined
-
Last visited
Everything posted by BinSlayer1
-
function damageCheck(attacker, weapon) local playeraccount = getPlayerAccount ( source ) if ( playeraccount ) and not isGuestAccount(playeraccount) then if getAccountData ( playeraccount, "carshow" ) then if(weapon == 5)then local x, y, z = getElementPosition(source) setElementPosition(source, x + 20, y + 50, z + 80) else end end end end addEventHandler( "onPlayerDamage", getRootElement(), damageCheck ) Just made your script server-side. I have no idea if it works as you intend it to.
-
-
well then you need to start learning https://wiki.multitheftauto.com/wiki/Scr ... troduction People don't usually do stuff for you in this forum unless you pay or whatever You've been pointed in the right direction and there's so much we can do.
-
get the element data BEFORE you use guiSetText
-
Hmm, gosh. I don't know.. Maybe it's because using tables is SO CRITICAL that you shouldn't use tables at all actually? I suggest reading up the wiki and see what is passed to the handler function.. https://wiki.multitheftauto.com/wiki/OnPlayerChat
-
local ncolor = getPlayerNametagColor(source) getPlayerNametagColor requires AN ARGUMENT @ "YOU THINK IM A IDIOT!!!, Im admin, and console. and my meta is the same as that! IVE HAD OVER 5 SERVERS!" Maybe you just calm the fuck down, I'm trying to help here and if you make me regret it I'll just ignore you from now on
-
1) sure you're admin/mod/supermod? 2) post meta.xml 3) any debug errors? type /debugscript 3 and restart the resource.
-
yeah sorry my bad this line: local accountname = getAccountName (getPlayerAccount(v)) source instead of v
-
redirectPlayer(player, "192.168.1.1", "22003") just change those values with your own server's
-
well your event handler, function parameters,IF conditions and elses were a mess, just take a look below.. function chatbox(text, command) local ncolor = getPlayerNametagColor() local name = getPlayerName(source) local accountname = getAccountName (getPlayerAccount(v)) if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Admin" ) ) then cancelEvent() outputChatBox("#FF0000[ADMIN] "..ncolor..name..": "..text) outputServerLog( "CHAT: [ADMIN] " .. getPlayerName ( source ).. ": " .. text) elseif isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "SuperModerator" ) ) then cancelEvent() outputChatBox("#FFAE00[sMOD] "..ncolor..name..": "..text) outputServerLog( "CHAT: [sMOD] " .. getPlayerName ( source ).. ": " .. text ) elseif isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Moderator" ) ) then cancelEvent() outputChatBox("#00FF00[MOD] "..ncolor..name..": "..text) outputServerLog( "CHAT: [MOD] " .. getPlayerName ( source ).. ": " .. text ) end end addEventHandler("onPlayerChat", getRootElement(), chatbox)
-
Question after question ~= learning Hint: trigger server event then trigger client event to root with playSound data
-
removePedJetPack - server only function client function toggleJetPack() triggerServerEvent('jetPackOff', getLocalPlayer()) end bindKey('j', 'down', toggleJetPack) server addEvent('jetPackOff', true) addEventHandler('jetPackOff', getRootElement(), function() removePedJetPack(source) end ) But I dont know how you can even give the jetpack clientside since givePedJetPack is ALSO serverside only.. But I guess you're on to something
-
\server\mods\deathmatch\resources\[gamemodes]\[race]\race\racevoting_server.lua line: 678 = 'nextmap' command you should use executeCommandHandler when a player buys a map, however lines 689 - 691 handle a check for admin rights. You need to find a way (maybe pass extra argument) to adjust it so that it skips this check if a map was bought by a player (i.e command was executed with executeCommandHandler)
-
of course you need to sync the files between webspace and server resources..
-
i think the webspace 'admin' resource is different from the server's admin resource
-
what if multiple players spawn at close intervals? function giveWeaponsOnSpawn2 ( player ) giveWeapon ( player, 24, 200 ) giveWeapon ( player, 34, 250 ) end playerTimers = {} function giveWeaponsOnSpawn ( theSpawnpont, theTeam ) playerTimers[source] = setTimer ( giveWeaponsOnSpawn2, 10000, 1, source) ---give The Player the weapons after 10 seconed end addEventHandler ( "onPlayerSpawn", getRootElement(), giveWeaponsOnSpawn )
-
Ralf122 there's no easy way of making it clientside as giveWeapon is apparently serverside only why can't you use serverside script?
-
clientside: function createPeds ( cmd, skin, weaponID, ammo ) local x, y, z = getElementPosition( getLocalPlayer() ) ped = createPed(tonumber(skin), x, y, z) giveWeapon ( ped, tonumber(weaponID), tonumber(ammo), true ) end addCommandHandler ( "ped", createPeds )
-
well change the event "setNextMap_s" from where it's defined and make it ignore admin checks if a special argument is given and just triggerServerEvent with that argument from your shop system or whatever
-
onPlayerLogin; check if hasObjectPermissionTo then setPlayerTeam search for these functions @ https://wiki.multitheftauto.com/
-
function onJoin() local team =getTeamFromName("Guests") setPlayerTeam(source, team) end addEventHandler("onPlayerJoin", getRootElement(), onJoin)
-
use setTimer and guiSetVisible? https://wiki.multitheftauto.com/wiki/SetTimer https://wiki.multitheftauto.com/wiki/GuiSetVisible
-
local distanz = createMarker ( -2006, 146, 28, cylinder, 10, 0, 0, 0, 0 ) function blitzer(hitElement, matchingDimension) if getElementType(hitElement) ~= "vehicle" then return end local player = getVehicleController(hitElement) speedx, speedy, speedz = getElementVelocity (hitElement) actualspeed = (speedx^2 + speedy^2 + speedz^2)^(0.5) mps = actualspeed * 50 kmh = actualspeed * 180 mph = actualspeed * 111.847 geld = kmh/100*200 if kmh > 100 then outputChatBox ( "Du hast die maximale Geschwindkeit überstritten!", player, 255, 0, 0) outputChatBox ( "Als Strafe wurden dir "..math.ceil(geld).."$ abgezogen!", player, 255, 0, 0) triggerClientEvent(player, "onStrafe", getRootElement()) setPlayerMoney(player, -math.ceil(tonumber(geld))) end end addEventHandler("onMarkerHit", distanz, blitzer)
-
function weapon () if source == getLocalPlayer() then if isPedHeadless ( source ) == true then triggerServerEvent ( "onPlayerWeaponFire", source ) end end end addEventHandler ( "onClientPlayerWeaponFire", getRootElement(), weapon ) function headless () outputChatBox ( "#ff8c00 -Cryptic KaMiKaSe- | #ff0000Você não pode atirar que nem um louco sem a cabeça !!!", source, 255, 255, 255, true ) fadeCamera ( source, false, 1.0, 0, 0, 0 ) setElementPosition ( source, -2866, 467, 4 ) takeAllWeapons ( source ) outputChatBox ( " ", source, 255, 255, 255, true ) outputChatBox ( " ", source, 255, 255, 255, true ) outputChatBox ( " ", source, 255, 255, 255, true ) outputChatBox ( "#ff8c00 - Cryptic KaMiKaSe- | #00ff00Você foi para o Hospital e foi curado ! Os médicos pegaram #ffff00R$1000 de você !", source, 255, 255, 255, true ) takePlayerMoney ( source, 1000 ) end addEvent ( "onPlayerWeaponFire", true ) addEventHandler ( "onPlayerWeaponFire", getRootElement(), headless ) edit: i edited the code minutes after posting so make sure u refresh the page