Jump to content

TheGrimReaper

Members
  • Posts

    37
  • Joined

  • Last visited

Everything posted by TheGrimReaper

  1. function create() FO = createTeam ( "Forever", 255, 0, 0 ) AV = createTeam ( "Avalanche", 255, 255, 255 ) GH = createTeam ( "Ghost", 255, 123, 0 ) end function addplayer(player, cmd, target, clan) local recipient = getPlayerFromName(target) local accName = getAccountName ( getPlayerAccount ( recipient ) ) -- get his account name if isObjectInACLGroup ("user."..accName, aclGetGroup ( clan ) ) then outputChatBox("* " .. recipientName .. " is already in your clan" , player, 255, 0, 0, true) else if recipient then local r, g, b local recipientName = getPlayerName(recipient) local playerName = getPlayerName(player) outputChatBox("*" .. recipientName .. " #FFFFFF has been added #FF0000" .. clan .. "#FFFFFF clan" , player, 255, 0, 0, true) outputChatBox("*" .. playerName .. " #FFFFFF added you to #FF0000" .. clan .. "#FFFFFF Clan", recipient, 255, 0, 0, true) setPlayerTeam ( recipient, clan ) r, g, b = getTeamColor (clan) setPlayerNametagColor ( recipient, r, g, b ) aclGroupAddObject (aclGetGroup(clan), "user."..accName) else outputChatBox("Sorry, we got 0 matches to the name" .. recipientName, player, 255, 0, 0) end end end function kickplayer(player, cmd, target, clan) local recipient = getPlayerFromName(target) local accName = getAccountName ( getPlayerAccount ( recipient ) ) -- get his account name local r,g,b if isObjectInACLGroup ("user."..accName, aclGetGroup ( clan ) ) then setPlayerTeam ( recipient, nil ) setPlayerNametagColor ( recipient, 225, 225, 225 ) aclGroupRemoveObject (aclGetGroup(clan), "user."..accName) else outputChatBox("The Player is Not in" .. clan .. "Clan" .. clan, player, 255, 0, 0) end end addCommandHandler("add", addplayer) addCommandHandler("ckick", kickplayer) addEventHandler ( "onResourceStart", getRootElement(), create ) This is a Clan system that i am working on, and when i run the script i get 2 errors , one is from the "setPlayerTeam" and the other one is from "GetTeamcolor" First One is : @ 'setPlayerTeam' [ Expected team at argument 2, got string 'AV' ] Second one is : @ 'getTeamColor' [Expected team at argument, got string 'AV'] Pls help me out , ik what this means but havent found a way to fix this And since This forum has helped me a lot , i am asking here , And also i would like to know a way to make this script to be able to Run for people In Acl group FOL , AVL and GHL ( which are clan leaders ) Thanks in Advance
  2. function check(source) local recipient = getPlayerFromName(source) local accName = getAccountName ( getPlayerAccount ( recipient ) ) -- get his account name local r,g,b if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Forever" ) ) then setPlayerTeam ( recipient, FO ) r, g, b = getTeamColor ( FO ) setPlayerNametagColor ( recipient, r, g, b ) end end addEventHandler ( "onPlayerLogin", getRootElement(), check ) ================================================================ i made a lil script to add clans but it seems that when u reconnect or login again , u are removed from player, the clan members are added into an ACL group marked Forever , i made this piece of code, to add player back into team if the player is in the acl group on login. but it doesnt work. I am not really good at this but , i dont know how to get player from server side , can someone pls explain to me what is wrong in this piece of code and also tell me how to get player from server side thanks
  3. thank you very much bro , it works just as i wanted it to
  4. yeah but only if the player was using CJ skin when he/she died and also there is a lil mistake on script ,sorry
  5. but in this case even if the person is not using CJ skin he/she wi be turned into CJ
  6. local skin = 1 function onps() if getElementModel == 0 then skin = 0 else skin = 1 end end addEventHandler("onPlayerWasted", root, onps) function onspn(source) if skin == 0 then setElementModel(source, 0) else end end addEventHandler("onPlayerWasted", root, onspn) This is a Script that is suppose to keep the skin same as CJ if Cj skin was applied when the player died ( obviously u guys will know from the code) But its or some reason not functioning , and i am not a pro either so please help me with this
  7. <script> GUIEditor = { gridlist = {}, window = {}, button = {}, label = {} } addEventHandler("onClientResourceStart", resourceRoot, function () GUIEditor.window[1] = guiCreateWindow(856, 143, 264, 388, "Walking Style", false) guiWindowSetSizable(name, false) label = guiCreateLabel(6, 1, 254, 15, "", false, GUIEditor.window[1]) GUIEditor.gridlist[1] = guiCreateGridList(28, 44, 209, 308, false, GUIEditor.window[1]) Default = guiCreateButton(10, 14, 189, 30, "Default", false, GUIEditor.gridlist[1]) Drunk = guiCreateButton(10, 54, 189, 30, "Drunk Man", false, GUIEditor.gridlist[1]) Sneak = guiCreateButton(10, 94, 189, 30, "Sneaking", false, GUIEditor.gridlist[1]) Blind = guiCreateButton(10, 134, 189, 30, "Blind Man", false, GUIEditor.gridlist[1]) Gangstar = guiCreateButton(10, 174, 189, 30, "Gangstar", false, GUIEditor.gridlist[1]) Sexy = guiCreateButton(10, 214, 189, 30, "Sexy", false, GUIEditor.gridlist[1]) fat = guiCreateButton(10, 254, 189, 30, "Fat man", false, GUIEditor.gridlist[1]) Close = guiCreateButton(104, 357, 58, 17, "Done", false, GUIEditor.window[1]) guiSetVisible(GUIEditor.window[1], false) guiSetVisible(Default, false) guiSetVisible(Drunk, false) guiSetVisible(Sneak, false) guiSetVisible(Blind, false) guiSetVisible(Gangstar, false) guiSetVisible(Sexy, false) guiSetVisible(fat, false) guiSetVisible(Close, false) guiSetVisible(GUIEditor.gridlist[1], false) addEventHandler ( "onClientGUIClick", guiRoot, setWalkingStyle ) end ) addCommandHandler("ws", function() guiSetVisible( GUIEditor.window[1], true ) guiSetVisible(Default, true) guiSetVisible(Drunk, true) guiSetVisible(Sneak, true) guiSetVisible(Blind, true) guiSetVisible(Gangstar, true) guiSetVisible(Sexy, true) guiSetVisible(fat, true) guiSetVisible(Close, true) guiSetVisible(GUIEditor.gridlist[1], true) showCursor( true ) end) function setWalkingStyle() if source == Default then setPedWalkingStyle ( localPlayer, 0 ) elseif source == Drunk then setPedWalkingStyle ( localPlayer, 126 ) elseif source == Sneak then setPedWalkingStyle ( localPlayer, 69 ) elseif source == Blind then setPedWalkingStyle ( localPlayer, 127 ) elseif source == Gangstar then setPedWalkingStyle ( localPlayer, 121 ) elseif source == Sexy then setPedWalkingStyle ( localPlayer, 132 ) elseif source == fat then setPedWalkingStyle ( localPlayer, 124 ) elseif source == Close then guiSetVisible( GUIEditor.window[1], false ) guiSetVisible(Default, false) guiSetVisible(Drunk, false) guiSetVisible(Sneak, false) guiSetVisible(Blind, false) guiSetVisible(Gangstar, false) guiSetVisible(Sexy, false) guiSetVisible(fat, false) guiSetVisible(Close, false) guiSetVisible(GUIEditor.gridlist[1], false) showCursor( false ) end end </script> finally done <3 thanks all for ur help and yes i know there is a nunch of useless things in there i was just too lazy to remove it
  8. @DNL291 thank you now i can see the Gui but , its there when the resources starts i mean , its not closed. and when i type /ws only the window shows up
  9. Hi guys here is my basic eject script, it doesnt exactly sling shot the player up but warps the player by increasing his z value o his current coordinates,, and the movement of camera makes it look like the person has ejected from the vehicle, but the problem is as its getting warped sometimes if some roof or etc is above u , it looks as if u are going through a wall, so i need a way to restrict eject when the area above is not clear. function eject( player ) local vehicle = getPedOccupiedVehicle(player) local driver = getVehicleOccupant(vehicle, 0) local x,y,z = getElementPosition( vehicle ) setElementVelocity(driver, 5, 5, 5) removePedFromVehicle(driver) setElementPosition ( driver,x, y, z + 100 ) giveWeapon ( driver, 46, 1 ) end addCommandHandler("eject", eject)
  10. sorry about less explanation, my bad , i get no error, i mean nothing happens, the gui doesnt bother to show. I made the Gui panel using Gui editor script in the resources section. and thank you @SSKE for the script but there are a lot of other walking style changing GUi's around but i want my gui to work , so hope fully i could know what went wrong here is how it looks like https://pasteboard.co/HneLYd0.jpg
  11. hello guys this is my first Gui project and i am pretty noob so can u please tell me whats wrong local player = getLocalPlayer () GUIEditor = { gridlist = {}, window = {}, button = {}, label = {} } function Panel() name = guiCreateWindow(856, 143, 264, 388, "Walking Style", false) guiWindowSetSizable(name, false) local label = guiCreateLabel(6, 1, 254, 15, "", false, GUIEditor.window[1]) GUIEditor.gridlist[1] = guiCreateGridList(28, 44, 209, 308, false, GUIEditor.window[1]) local Default = guiCreateButton(10, 14, 189, 30, "Default", false, GUIEditor.gridlist[1]) local Drunk = guiCreateButton(10, 54, 189, 30, "Drunk Man", false, GUIEditor.gridlist[1]) local Sneak = guiCreateButton(10, 94, 189, 30, "Sneaking", false, GUIEditor.gridlist[1]) local Blind = guiCreateButton(10, 134, 189, 30, "Blind Man", false, GUIEditor.gridlist[1]) local Gangstar = guiCreateButton(10, 174, 189, 30, "Gangstar", false, GUIEditor.gridlist[1]) local Sexy = guiCreateButton(10, 214, 189, 30, "Sexy", false, GUIEditor.gridlist[1]) local fat = guiCreateButton(10, 254, 189, 30, "Fat man", false, GUIEditor.gridlist[1]) local Close = guiCreateButton(104, 357, 58, 17, "Done", false, GUIEditor.window[1]) showCursor ( true ) end addCommandHandler("ws", panel) function Reset() setPedWalkingStyle ( player, 0 ) end function Drunk() setPedWalkingStyle ( player, 126 ) end function Sneak() setPedWalkingStyle ( player, 69 ) end function Blind() setPedWalkingStyle ( player, 127 ) end function Gangstar() setPedWalkingStyle ( player, 121 ) end function Sexy() setPedWalkingStyle ( player, 132 ) end function Fat() setPedWalkingStyle ( player, 124 ) end function Close() guiSetVisible ( name, false ) showCursor ( false ) end addEventHandler ( "onClientGUIClick", Default, Reset, false ) addEventHandler ( "onClientGUIClick", Drunk, Drunk, false ) addEventHandler ( "onClientGUIClick", Sneak, Sneak, false ) addEventHandler ( "onClientGUIClick", Blind, Blind, false ) addEventHandler ( "onClientGUIClick", Gangstar, Gangstar, false ) addEventHandler ( "onClientGUIClick", Sexy, Sexy, false ) addEventHandler ( "onClientGUIClick", Fat, Fat, false ) addEventHandler ( "onClientGUIClick", close, close, false )
×
×
  • Create New...