Jump to content

mouadys

Members
  • Posts

    11
  • Joined

  • Last visited

Everything posted by mouadys

  1. Hello, i made a teamkick script accessible for players in ACL group Deputy I don't get any output function usnskick (sourceplayer, command, who) local TargetPlayer = getPlayerFromName (who) local accName = getAccountName ( getPlayerAccount (sourceplayer) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Deputy" ) ) then if isPlayerInTeam ( TargetPlayer, "US_Navy_SEALs" ) then setPlayerTeam (TargetPlayer, nil) end end end addCommandHandler ("kickusns", usnskick ) Thank you
  2. Look at this , here is my code : Server function changeSkin(player, playerName, item, skin) setElementModel( player, skin ) end addEvent("changeSkin", true) addEventHandler("changeSkin", root, changeSkin) Client GUIEditor = { label = {}, edit = {}, button = {}, window = {}, combobox = {}, memo = {} } GUIEditor.window[1] = guiCreateWindow(451, 289, 327, 426, "Skin", false) guiWindowSetSizable(GUIEditor.window[1], false) GUIEditor.combobox[1] = guiCreateComboBox(48, 322, 258, 94, "", false, GUIEditor.window[1]) guiComboBoxAddItem(GUIEditor.combobox[1], "285") guiComboBoxAddItem(GUIEditor.combobox[1], "287") GUIEditor.button[1] = guiCreateButton(129, 45, 119, 32, "Close", false, GUIEditor.combobox[1]) GUIEditor.button[2] = guiCreateButton(48, 367, 108, 32, "Get Skin", false, GUIEditor.window[1]) GUIEditor.memo[1] = guiCreateMemo(27, 63, 279, 163, "This GUI allows you to get a custom skin for you or a player name", false, GUIEditor.window[1]) GUIEditor.edit[1] = guiCreateEdit(47, 261, 255, 31, "", false, GUIEditor.window[1]) GUIEditor.label[1] = guiCreateLabel(129, 242, 218, 15, "Player Name :", false, GUIEditor.window[1]) GUIEditor.label[2] = guiCreateLabel(142, 299, 159, 23, "Skin :", false, GUIEditor.window[1]) guiSetVisible(GUIEditor.window[1], false) guiSetVisible(GUIEditor.combobox[1], false) guiSetVisible(GUIEditor.button[1], false) guiSetVisible(GUIEditor.memo[1], false) guiSetVisible(GUIEditor.edit[1], false) guiSetVisible(GUIEditor.label[2], false) guiSetVisible(GUIEditor.label[1], false) guiSetVisible(GUIEditor.button[2], false) function OpenGUI() guiSetVisible(GUIEditor.window[1], true) guiSetVisible(GUIEditor.combobox[1], true) guiSetVisible(GUIEditor.button[1], true) guiSetVisible(GUIEditor.memo[1], true) guiSetVisible(GUIEditor.edit[1], true) guiSetVisible(GUIEditor.label[2], true) guiSetVisible(GUIEditor.label[1], true) guiSetVisible(GUIEditor.button[2], true) showCursor(true) guiMemoSetReadOnly ( GUIEditor.memo[1], true ) toggleControl ("chatbox", false) end addCommandHandler("skineditor", OpenGUI) function editSkin() local item = guiComboBoxGetSelected(GUIEditor.combobox[1]) local skin = guiComboBoxGetItemText(GUIEditor.combobox[1], item) local playerName = guiGetText(GUIEditor.edit[1]) local player = getPlayerFromName ( playerName ) triggerServerEvent ("changeSkin", localPlayer, item, skin, player, playerName) end function Close() guiSetVisible(GUIEditor.window[1], false) guiSetVisible(GUIEditor.combobox[1], false) guiSetVisible(GUIEditor.button[1], false) guiSetVisible(GUIEditor.memo[1], false) guiSetVisible(GUIEditor.edit[1], false) guiSetVisible(GUIEditor.button[2], false) guiSetVisible(GUIEditor.label[2], false) guiSetVisible(GUIEditor.label[1], false) showCursor(false) toggleControl ("chatbox", true) end addEventHandler("onClientGUIClick", GUIEditor.button[1], Close, false) addEventHandler("onClientGUIClick", GUIEditor.button[2], editSkin, false) I press the button and i get error on Console : Bad Argument @ 'setElementModel' [Expected element at argument , got number '-1' ]
  3. Hello , i made a script to spawn vehicle and set player as driver , and it only works if you are admin . But i want to destroy that vehicle with a command and i dont know how . function createVehicleForPlayer(thePlayer, command, ...) local x,y,z = getElementPosition(thePlayer) -- get the position of the player x = x + 3 local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) local vehicleName = table.concat({...}, " ") local vehID = getVehicleModelFromName ( vehicleName ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then local createdVehicle = createVehicle( vehID,x,y,z ) warpPedIntoVehicle ( thePlayer, createdVehicle ) setVehicleDamageProof(createdVehicle, true) if (createdVehicle == false) then -- if so, output a message to the chatbox, but only to this player. outputChatBox("Failed to create vehicle.",thePlayer) else outputChatBox("Vehicle has been created",thePlayer) end end end addCommandHandler("cv", createVehicleForPlayer) function destroy(thePlayer, command ) destroyElement ( createdVehicle ) end addCommandHandler ("dv", destroy)
  4. Here is the code (its from Clientside) . triggerServerEvent ("changeSkin", localPlayer, item, skin, player, playerh) Is it correct ? Because it still not working
  5. The biggest problem is that the script isn't working , i press the button but nothing happens . And when i restart the resource , the chatbox still disabled .
  6. Thank you , the problem with chatbox is fixed , but the admin panel still show on when i press P . And @50p , i dont understand what you mean , can you explain more please ?
  7. Hello , i made a gui to change player skin but it doesn't work Client-side GUIEditor = { label = {}, edit = {}, button = {}, window = {}, combobox = {}, memo = {} } GUIEditor.window[1] = guiCreateWindow(451, 289, 327, 426, "Skin", false) guiWindowSetSizable(GUIEditor.window[1], false) GUIEditor.combobox[1] = guiCreateComboBox(48, 322, 258, 94, "", false, GUIEditor.window[1]) guiComboBoxAddItem(GUIEditor.combobox[1], "285") guiComboBoxAddItem(GUIEditor.combobox[1], "287") GUIEditor.button[1] = guiCreateButton(68, 360, 197, 44, "Get Skin", false, GUIEditor.window[1]) GUIEditor.memo[1] = guiCreateMemo(27, 63, 279, 163, "This GUI allows you to get a custom skin for you or a player name", false, GUIEditor.window[1]) GUIEditor.edit[1] = guiCreateEdit(47, 261, 255, 31, "", false, GUIEditor.window[1]) GUIEditor.label[1] = guiCreateLabel(129, 242, 218, 15, "Player Name :", false, GUIEditor.window[1]) GUIEditor.label[2] = guiCreateLabel(142, 299, 159, 23, "Skin :", false, GUIEditor.window[1]) guiSetVisible(GUIEditor.window[1], false) guiSetVisible(GUIEditor.combobox[1], false) guiSetVisible(GUIEditor.button[1], false) guiSetVisible(GUIEditor.memo[1], false) guiSetVisible(GUIEditor.edit[1], false) guiSetVisible(GUIEditor.label[2], false) guiSetVisible(GUIEditor.label[1], false) function OpenGUI() guiSetVisible(GUIEditor.window[1], true) guiSetVisible(GUIEditor.combobox[1], true) guiSetVisible(GUIEditor.button[1], true) guiSetVisible(GUIEditor.memo[1], true) guiSetVisible(GUIEditor.edit[1], true) guiSetVisible(GUIEditor.label[2], true) guiSetVisible(GUIEditor.label[1], true) showCursor(true) guiMemoSetReadOnly ( GUIEditor.memo[1], true ) toggleControl (chatbox, false) end addCommandHandler("skineditor", OpenGUI) function editSkin() triggerServerEvent ("changeSkin", localPlayer) end addEventHandler("onClientGUIClick", GUIEditor.button[1], editSkin, false) There is a problem : toggleControl (chatbox, false) isn't working , when i type text , binds are working Server-side function changeSkin() local item = guiComboBoxGetSelected(GUIEditor.combobox[1]) local skin = guiComboBoxGetItemText(GUIEditor.combobox[1], item) local player = guiGetText(GUIEditor.edit[1]) local playerh = getPlayerFromName ( player ) setElementModel ( playerh, skin ) end addEvent("changeSkin", true) addEventHandler("editSkin", root, changeSkin) I press the button but nothing happens . Thank you .
  8. Hello , i want to make a skin editor that changes other or your player skins that you open with a command (/skineditor) and there you find a combobox and a button The combobox contains some Skins and the button is to set your or someone skin . As i'm new in scripting , i dont know what to do , i used GUI Editor and i made this GUI but i dont know what to do next on both serverside and clienside GUIEditor = { label = {}, edit = {}, button = {}, window = {}, combobox = {}, memo = {} } addEventHandler("onClientResourceStart", resourceRoot, function() GUIEditor.window[1] = guiCreateWindow(451, 289, 327, 426, "Skin", false) guiWindowSetSizable(GUIEditor.window[1], false) GUIEditor.combobox[1] = guiCreateComboBox(48, 322, 258, 94, "", false, GUIEditor.window[1]) guiComboBoxAddItem(GUIEditor.combobox[1], "SWAT skin") guiComboBoxAddItem(GUIEditor.combobox[1], "Army Skin") GUIEditor.button[1] = guiCreateButton(68, 360, 197, 44, "Get Skin", false, GUIEditor.window[1]) GUIEditor.memo[1] = guiCreateMemo(27, 63, 279, 163, "This GUI allows you to get a custom skin for you or a player name", false, GUIEditor.window[1]) GUIEditor.edit[1] = guiCreateEdit(47, 261, 255, 31, "", false, GUIEditor.window[1]) GUIEditor.label[1] = guiCreateLabel(129, 242, 218, 15, "Player Name :", false, GUIEditor.window[1]) GUIEditor.label[2] = guiCreateLabel(142, 299, 159, 23, "Skin :", false, GUIEditor.window[1]) end )
  9. mouadys

    Create a server ?

    i do but when i start a server i dont see any RP
  10. mouadys

    Create a server ?

    Hello everybody, I wanna know how to create a RP MTA server . How to do it ? where to place the files ?
×
×
  • Create New...