
Samking
Members-
Posts
57 -
Joined
-
Last visited
Everything posted by Samking
-
How I can set the time to command for example if I type /givemecash command I will not able to use this command again before 30 mins. How I can do this?
-
can you do this please I am in hurry
-
function centerWindow(center_window) local screenW,screenH=guiGetScreenSize() local windowW,windowH=guiGetSize(center_window,false) local x,y = (screenW-windowW)/2,(screenH-windowH)/2 guiSetPosition(center_window,x,y,false) end GUIEditor = { checkbox = {}, staticimage = {}, label = {}, button = {}, window = {} } addEventHandler("onClientResourceStart", resourceRoot, function() GUIEditor.window[1] = guiCreateWindow(542, 254, 348, 92, "Peacemode Interference", false) centerWindow ( GUIEditor.window[1] ) guiSetProperty(GUIEditor.window[1], "CaptionColour", "FFF0D30E") guiWindowSetSizable(GUIEditor.window[1], false) GUIEditor.label[1] = guiCreateLabel(10, 25, 283, 15, "You can enable/disable 'Peacemode'", false, GUIEditor.window[1]) guiSetFont(GUIEditor.label[1], "default-bold-small") guiLabelSetColor(GUIEditor.label[1], 253, 0, 0) GUIEditor.staticimage[1] = guiCreateStaticImage(10, 50, 34, 26, "icon.png", false, GUIEditor.window[1]) GUIEditor.checkbox[1] = guiCreateCheckBox(49, 52, 234, 24, "Enable/Disable peacemode", false, false, GUIEditor.window[1]) guiSetFont(GUIEditor.checkbox[1], "default-bold-small") guiSetProperty(GUIEditor.checkbox[1], "NormalTextColour", "FF30EB11") GUIEditor.button[1] = guiCreateButton(303, 52, 31, 25, "X", false, GUIEditor.window[1]) guiSetFont(GUIEditor.button[1], "default-bold-small") guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FF1428E7") GUIEditor.label[2] = guiCreateLabel(78, 74, 120, 15, "Romania Chill Nation", false, GUIEditor.window[1]) guiSetFont(GUIEditor.label[2], "default-bold-small") guiLabelSetColor(GUIEditor.label[2], 12, 238, 193) guiSetVisible(GUIEditor.window[1], false) addEventHandler("onClientGUIClick", GUIEditor.button[1], onGuiClick,false) addEventHandler("onClientGUIClick",GUIEditor.checkbox[1], checkBox, false) end ) addCommandHandler("passive", function() guiSetVisible(GUIEditor.window[1], true) showCursor(true) end ) function onGuiClick() guiSetVisible(GUIEditor.window[1], false) showCursor(false) end function checkBox() if ( guiCheckBoxGetSelected(GUIEditor.checkbox[1])) then setElementData(localPlayer, "invincible", true) addEventHandler("onClientRender", root, dxRectangle) else setElementData(localPlayer, "invincible", false) removeEventHandler( "onClientRender", root, dxRectangle ) end end addEventHandler ( "onClientPlayerDamage",localPlayer, function () if getElementData(source,"invincible") then cancelEvent() end end ) function dxRectangle() dxDrawImage(90, 479, 27, 24, "icon.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawText("Peacemode Enabled", 123, 485, 294, 497, tocolor(255, 167, 0, 255), 0.70, "bankgothic", "left", "top", false, false, false, false, false) end function disableWeaponOnGodMod (prev,new) if getElementData(localPlayer, "invincible") then setPedWeaponSlot(localPlayer, 0) toggleControl ( "aim_weapon", false) toggleControl ( "fire", false) toggleControl ( "vehicle_fire", false) toggleControl ( "vehicle_secondary_fire", false) else toggleControl ( "aim_weapon", true) toggleControl ( "vehicle_fire", true) toggleControl ( "fire", true) toggleControl ( "vehicle_secondary_fire", true) end end addEventHandler ( "onClientRender", root, disableWeaponOnGodMod ) function dmg(player) car = getPedOccupiedVehicle ( player) if isVehicleDamageProof(car) == true then setVehicleDamageProof(car, false) else setVehicleDamageProof(car, true) end end addEventHandler ( "onClientVehicleExplode", root, dmg ) This Code is not made by me I download this from MTA sa community How I can make this command /passive which only can use by VIP acl group?
-
local gate = createObject(971, 2582.1005859375, -2115.7998046875, 3.5999999046326, 0, 0, 179.99450683594) local marker = createMarker(2581.15039, -2108.35376, 1.49555, "cylinder", 8, 0, 0, 0, 0) function moveGate(psource) local Omegausergroup = getAccountName(getPlayerAccount(psource)) if isObjectInACLGroup("user."..Xyruviausergroup, aclGetGroup("VIP")) then moveObject(gate, 1000, 263.9, -1333.5, 46) end end addEventHandler("onMarkerHit", marker, moveGate) function move_back_gate() moveObject(gate, 1000, 263.9, -1333.5, 53.251480102539) end addEventHandler("onMarkerLeave", marker, move_back_gate) error attempt to concatenate global a userdata value. help plz fast
-
function makePed() ped1 = createPed(125,2581.99756, -2137.35791, -0.10042) setTimer(function() setPedRotation(ped1, 90.0041198) setPedAnimation(ped1, "WUZI", "CS_Dead_Guy") end, 100, 1) end How I can fix this like when someone shoots ped, ped stops anim
-
thanks but this visible to only VIPs?
-
make it easy bls for VIP acl group when I type /v text this only show my name I cant be able to see text
-
this code is made by my friend that's why I am getting difficulties.
-
how can I create a chat for acl?
-
before the test, I set myself in VIP group but still giving me the error
-
local isPlayerInGroup, onChat local function onChatCommand (player) if isPlayerInGroup (player, "VIP") then onChat (player) else outputChatBox ("You must be VIP to use this command.", player,255,0, 0,true) end end addCommandHandler("v", onChatCommand) chat_range=10000000 addEventHandler("onPlayerJoin",getRootElement(), function () end) addEventHandler("onResourceStart",getResourceRootElement(getThisResource()), function () for index, player in pairs(getElementsByType("player")) do end end) function isPlayerInRangeOfPoint(player,x,y,z,range) local px,py,pz=getElementPosition(player) return ((x-px)^2+(y-py)^2+(z-pz)^2)^0.5<=range end function onChat(player,_,...) local px,py,pz=getElementPosition(player) local msg = table.concat({...}, " ") local nick=getPlayerName(player) local r,g,b = getTeamColor(getPlayerTeam(player)) for _,v in ipairs(getElementsByType("player")) do if isPlayerInRangeOfPoint(v,px,py,pz,chat_range) then outputChatBox("[VIP Chat]"..nick..": #ffffff"..msg,v,255,0,255,true) end end end function isPlayerInGroup (player, group) local playerAccount = getPlayerAccount ( player ) if playerAccount then local accName = getAccountName ( playerAccount ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( group ) ) then return true end end return false end Can someone tell me how to make separate VIP chat and that can visible to those who are in the VIP group? I am getting this error Bad argument @ 'getTeamColor' [Expected team at argument 1 , got boollean] Can someone make code and send me plz Thanks!
-
sorry, but the error is still same.
-
error attempt to call global 'getPlayerFromPartialName' <a nil value>
-
In this code local isPlayerInGroup, givemoney local function givemoneycommand (player) if isPlayerInGroup (player, "VIP") then giveCash (player) else outputChatBox ("You must be VIP to use this command.", player,255,0, 0,true) end end addCommandHandler("givemoney", givemoneycommand) function findPlayer( namepart ) local targetPlayer = getPlayerFromName ( who ) if ( targetPlayer ) then return player end for _,player in pairs( getElementsByType 'player' ) do if string.find( string.gsub( getPlayerName( player ):lower( ),"#%x%x%x%x%x%x", "" ), namepart:lower( ), 1, true ) then return player end end return false end addCommandHandler( 'givemoney', function( source,_,player,amount ) local find = findPlayer( player ) if find then if amount then -- If player type amount ( full command /givemoney [nickname][amount] ) givePlayerMoney( find,tonumber( amount ) ) -- give money for player outputChatBox( '[givemoney]:You transfer $'..amount..' to '..getPlayerName( find ),source,255,0,0 ) else -- player not type full command ( /givemoney [nickname][amount] ) outputChatBox( '[givemoney]:/givemoney [playername][amount]!',source,255,0,0 ) end else outputChatBox( '[givemoney]:Player not found!',source,255,0,0 ) end end ) function isPlayerInGroup (player, group) local playerAccount = getPlayerAccount ( player ) if playerAccount then local accName = getAccountName ( playerAccount ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( group ) ) then return true end end return false end Bad srgument @'getPlayerFromName [Expected string at argument 1 , got nill] and this code function enterVehicle (player, seat, jacked) local accName = getAccountName (getPlayerAccount (player) if not isObjectInACLGroup("user."..accName, aclGetGroup ( "VIP" )) and getElementModel(source) == 412 then cancelEvent() outputChatBox ( "you must be VIP to use this vehicle", player) end end addEventHandler ( "onVehicleStartEnter", getRootElement(), enterVehicle ) and this code is not working this spawn only car and give this car to those who is not VIP
-
local isPlayerInGroup, givemoney local function givemoneycommand (player) if isPlayerInGroup (player, "VIP") then giveCash (player) else outputChatBox ("You must be VIP to use this command.", player,255,0, 0,true) end end addCommandHandler("givemoney", givemoneycommand) function findPlayer( namepart ) local targetPlayer = getPlayerFromName ( who ) if ( targetPlayer ) then return player end for _,player in pairs( getElementsByType 'player' ) do if string.find( string.gsub( getPlayerName( player ):lower( ),"#%x%x%x%x%x%x", "" ), namepart:lower( ), 1, true ) then return player end end return false end addCommandHandler( 'givemoney', function( source,_,player,amount ) local find = findPlayer( player ) if find then if amount then -- If player type amount ( full command /givemoney [nickname][amount] ) givePlayerMoney( find,tonumber( amount ) ) -- give money for player outputChatBox( '[givemoney]:You transfer $'..amount..' to '..getPlayerName( find ),source,255,0,0 ) else -- player not type full command ( /givemoney [nickname][amount] ) outputChatBox( '[givemoney]:/givemoney [playername][amount]!',source,255,0,0 ) end else outputChatBox( '[givemoney]:Player not found!',source,255,0,0 ) end end ) function isPlayerInGroup (player, group) local playerAccount = getPlayerAccount ( player ) if playerAccount then local accName = getAccountName ( playerAccount ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( group ) ) then return true end end return false end And this
-
function enterVehicle (player, seat, jacked) local accName = getAccountName (getPlayerAccount (player) if not isObjectInACLGroup("user."..accName, aclGetGroup ( "VIP" )) and getElementModel(source) == 412 then cancelEvent() outputChatBox ( "you must be VIP to use this vehicle", player) end end addEventHandler ( "onVehicleStartEnter", getRootElement(), enterVehicle ) help me in this
-
Thanks for helping me
-
is this code is correct? still the same.....
-
I 've got an error this gives Only Output that "You are not in the VIP group" I set my self in VIP group but still give output "You are not in the VIP group"/> And in console Warning: givecash/script.lua:22: Bad argument @ getPlayerAccount [Expected element at argument 1 got nil]
-
thanks, I will try if the player in VIP group type /givemecash command this will visible to those who are in VIP group? or all?
-
local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "VIP" ) ) then giveCash ( thePlayer ) end end ) function giveCash (player) givePlayerMoney(player,1000000) outputChatBox ("$-----------------------------------------------------------------------------------------------$",source,0, 255, 0,true) outputChatBox ("The player'"..getPlayerName(player).."' is rich now because he ",source,250, 255, 0,true) outputChatBox ("Has received 10m$ ",source,0, 255, 221,true) outputChatBox ("$-----------------------------------------------------------------------------------------------$",source,0, 255, 0,true) end addCommandHandler("givemecash",giveCash) function giveCash (player) givePlayerMoney(player,99999999) outputChatBox ("$---------------------------------------------------------------------------------------------$",source,0, 255, 0,true) outputChatBox ("The player'"..getPlayerName(player).."' is extremely rich now because he ",source,250, 255, 0,true) outputChatBox (" Has received 99m$ ",source,0, 255, 221,true) outputChatBox ("$---------------------------------------------------------------------------------------------$",source,0, 255, 0,true) end
-
I am shy to show ma script because a lot of mistakes I have done in it. Can you make one for me, please?