Jump to content

Castillo

Retired Staff
  • Posts

    21,935
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Castillo

  1. Castillo

    blow

    here it is fixed function blowVeh ( player, command, someguy ) if someguy then local temp = getPlayerFromName(someguy) if temp then local theVehicle = getPedOccupiedVehicle ( temp ) if theVehicle then blowVehicle ( theVehicle ) outputChatBox("" ..someguy.. " has been blown", getRootElement(), 255, 0, 0) end end end end addCommandHandler ( "boom", blowVeh )
  2. yea! finally works, thank you so much!
  3. i just changed to "player" and is same, just genting the nick not the account name
  4. hey again, i have a problem genting the account name of the player selected from a grid list, before it just returned the player nick but now just outputs a warning at debug script, here is my code. server function update(client) local who = getPlayerFromName (client) local account = getAccount (client) triggerClientEvent ( "updateGuis", getRootElement(), getPlayerIP ( who ), getPlayerSerial ( who ), getAccountName ( account ), getPlayerMoney ( who ), getPlayerPing ( who ) ) end addEvent("updateGui", true) addEventHandler("updateGui", getRootElement(), update) those other stuff is working fine, just account name dosnt work.
  5. ok well, you have to go to this directory ( maybe isnt same disk drive for you ): c:\Program Files\MTA San Andreas\server\mods\deathmatch\resources\ and there u can add folder with the resource or just the zips. i hope i helped u
  6. Use my code... As you can see, there is new player variable and client is changed to playerName. thanks now finally works :D
  7. Hmmm, to redirect to other server you can use my code function joinserverHandlerFunction (playerSource, commandName, serverIP, serverPort) redirectPlayer (playerSource, "77.160.183.15", tonumber(20001)) end addCommandHandler ("joinserver", joinserverHandlerFunction)
  8. if i rename all "client" to "player" all functions stops working
  9. ok, i changed to repairVehicle as function name but still same problem with getPedOccupiedVehicle, this is the error. Bad argument @ "getPedOccupiedVehicle"
  10. thanks , soon v2.0 is ready
  11. Castillo

    snip

    You wont get any free scripter in this forums. i recommend u to start learning how to script and make yourself your own stuff
  12. he wasnt asking for this O_o, he asked for a character system maybe?
  13. hey, while scripting my panel i got stuck in a function that seems to dont work, i will post code here maybe someone can help me. server: function fixVehicle(client) local theVehicle = getPedOccupiedVehicle ( client ) if ( theVehicle ) then fixVehicle ( theVehicle ) local rx, ry, rz = getVehicleRotation ( theVehicle ) if ( rx > 110 ) and ( rx < 250 ) then local x, y, z = getElementPosition ( theVehicle ) setVehicleRotation ( theVehicle, rx + 180, ry, rz ) setElementPosition ( theVehicle, x, y, z + 2 ) end end end client: function repairVehicle() if source == repair then selectedPlayer = guiGridListGetItemText ( playersList, guiGridListGetSelectedItem (playersList), 1 ) if ( guiGridListGetSelectedItem ( playersList ) ~= -1 ) then triggerServerEvent ("repairVeh", getRootElement(), selectedPlayer, client) else outputChatBox("No user selected.", nil , 255, 0, 0, false) end end end
  14. lol, wtf is this? ask here for scripting problems not how to copy a server!
  15. C-Panel v3.0 This is a new admin panel called C-Panel, not much more to say, just test it! Commands: - Press O : To make visible the c-panel. - /clearchat : To clear all players chat. Features [*] Player info, account name, ip, serial, money, skin, team, position [*] Player name changer [*] Mute / UnMute [*] Kick [*] Freeze / Unfreeze [*] Slap [*] Give jetpack / Remove jetpack [*] Spectate / Un-Spectate [*] Jail / Unjail [*] Kill [*] Set sky color / Reset Sky color [*] Bomb to blow players [*] Burn [*] Eject driver from car [*] Zap [*] Shout at player screen [*] Give vehicle / Blow vehicle / Destroy vehicle [*] Admin announce [*] Clear chat [*] Set team / Create team [*] Set Water color / Reset Water color [*] Bans list [*] Resources list / Start resource / Stop resource / Restart resource [*] Unban IP / Unban Serial [*] Ban IP / Ban Serial [*] Give weapons [*] Set money [*] Resource settings [*] Report system Credits to: - R3mp : For the guieditor. - Cannonball : For some functions from UserSystem. - Special thanks to 50p from mta forums for helping me with some features. - Special thanks to xownage for helping me to make the bans lists. Enjoy! installation: open your acl.xml and add in group "admin" the following line: Enjoy! DOWNLOAD: Click here!
  16. use my userpanel if u dont know how to make the other working. Click here!
  17. i dont know, i will do that later maybe btw this code still dosnt work.
  18. ok well i did that but now dosnt work and dosnt give me any error/warning in debug scipt function drawText ( mytext ) if(mytext) then triggerServerEvent ( "ownText", getRootElement(), getLocalPlayer(),mytext) end end addCommandHandler ( "text", drawText ) local myTextDisplay = textCreateDisplay () myTextItem = textCreateTextItem ( mytext, .5, .5, "low", 255, 0, 0, 150, 4.0, "center" ) function test(mytext) textDisplayAddObserver ( myTextDisplay, source ) setTimer ( textDisplayRemoveObserver, 3000, 1, myTextDisplay, source ) textDisplayAddText ( myTextDisplay, myTextItem ) end addEvent("ownText", true) addEventHandler( "ownText",getRootElement(), test ) any idea?
  19. well, how i do that?
  20. hahaahah wtf? no, u have to make a folder and make a lua file and a meta.xml and is done
  21. this sounds me like "MessOfHell" topics, im the only who thinks he is moh?
  22. im sorry but u copyed it from my code at least server side parts https://forum.multitheftauto.com/viewtopic.php?f=91&t=27814&st=0&sk=t&sd=a&start=15 but well, i fixed all code for you. client side: GUIEditor_Window = {} GUIEditor_TabPanel = {} GUIEditor_Tab = {} GUIEditor_Button = {} GUIEditor_Memo = {} GUIEditor_Label = {} function toggleVisible ( ) if ( guiGetVisible ( GUIEditor_Window[1] ) == true ) then guiSetVisible ( GUIEditor_Window[1], false ) showCursor ( false ) else guiSetVisible ( GUIEditor_Window[1], true ) showCursor ( true ) end end bindKey ( "F6", "down", toggleVisible ) local player = getPlayerName(getLocalPlayer()) local playerMoney = getPlayerMoney(source) local playerPoints = getElementData(getLocalPlayer(), "Points") local playerWins = getElementData(getLocalPlayer(), "Wins") local playerLoses = getElementData(getLocalPlayer(), "Loses") GUIEditor_Window[1] = guiCreateWindow(11,135,275,194,"User panel",false) guiSetVisible( GUIEditor_Window[1], false) GUIEditor_TabPanel[1] = guiCreateTabPanel(12,23,249,162,false,GUIEditor_Window[1]) GUIEditor_Tab[1] = guiCreateTab("User",GUIEditor_TabPanel[1]) GUIEditor_Label[1] = guiCreateLabel(10,11,222,19,"Name: " .. player,false,GUIEditor_Tab[1]) guiLabelSetColor(GUIEditor_Label[1],255,255,255) guiLabelSetVerticalAlign(GUIEditor_Label[1],"top") guiLabelSetHorizontalAlign(GUIEditor_Label[1],"left",false) GUIEditor_Label[2] = guiCreateLabel(10,32,222,19,"Money: $ " ..playerMoney,false,GUIEditor_Tab[1]) guiLabelSetColor(GUIEditor_Label[2],255,255,255) guiLabelSetVerticalAlign(GUIEditor_Label[2],"top") guiLabelSetHorizontalAlign(GUIEditor_Label[2],"left",false) GUIEditor_Label[3] = guiCreateLabel(10,52,222,19,"Points: " .. playerPoints,false,GUIEditor_Tab[1]) guiLabelSetColor(GUIEditor_Label[3],255,255,255) guiLabelSetVerticalAlign(GUIEditor_Label[3],"top") guiLabelSetHorizontalAlign(GUIEditor_Label[3],"left",false) GUIEditor_Label[4] = guiCreateLabel(10,52,222,19,"Wins: " .. playerWins,false,GUIEditor_Tab[1]) guiLabelSetColor(GUIEditor_Label[3],255,255,255) guiLabelSetVerticalAlign(GUIEditor_Label[3],"top") guiLabelSetHorizontalAlign(GUIEditor_Label[3],"left",false) GUIEditor_Label[5] = guiCreateLabel(10,52,222,19,"Loses: " .. playerLoses,false,GUIEditor_Tab[1]) guiLabelSetColor(GUIEditor_Label[3],255,255,255) guiLabelSetVerticalAlign(GUIEditor_Label[3],"top") guiLabelSetHorizontalAlign(GUIEditor_Label[3],"left",false) GUIEditor_Tab[2] = guiCreateTab("Shop",GUIEditor_TabPanel[1]) GUIEditor_Label[6] = guiCreateLabel(18,14,142,16,"Repair:",false,GUIEditor_Tab[2]) guiLabelSetColor(GUIEditor_Label[4],255,255,255) guiLabelSetVerticalAlign(GUIEditor_Label[4],"top") guiLabelSetHorizontalAlign(GUIEditor_Label[4],"left",false) GUIEditor_Label[7] = guiCreateLabel(18,33,142,16,"Nitro:",false,GUIEditor_Tab[2]) guiLabelSetColor(GUIEditor_Label[5],255,255,255) guiLabelSetVerticalAlign(GUIEditor_Label[5],"top") guiLabelSetHorizontalAlign(GUIEditor_Label[5],"left",false) GUIEditor_Label[8] = guiCreateLabel(18,53,142,16,"Barrel:",false,GUIEditor_Tab[2]) guiLabelSetColor(GUIEditor_Label[6],255,255,255) guiLabelSetVerticalAlign(GUIEditor_Label[6],"top") guiLabelSetHorizontalAlign(GUIEditor_Label[6],"left",false) GUIEditor_Label[9] = guiCreateLabel(18,73,142,16,"Haystack:",false,GUIEditor_Tab[2]) guiLabelSetColor(GUIEditor_Label[7],255,255,255) guiLabelSetVerticalAlign(GUIEditor_Label[7],"top") guiLabelSetHorizontalAlign(GUIEditor_Label[7],"left",false) GUIEditor_Button[1] = guiCreateButton(67,14,46,17,"$3500",false,GUIEditor_Tab[2]) GUIEditor_Button[2] = guiCreateButton(62,34,46,17,"$2000",false,GUIEditor_Tab[2]) GUIEditor_Button[3] = guiCreateButton(50,54,46,17,"$1500",false,GUIEditor_Tab[2]) GUIEditor_Button[4] = guiCreateButton(88,74,46,17,"$3000",false,GUIEditor_Tab[2]) GUIEditor_Button[5] = guiCreateButton(92,94,46,17,"$4000",false,GUIEditor_Tab[2]) GUIEditor_Tab[3] = guiCreateTab("Credits",GUIEditor_TabPanel[1]) GUIEditor_Memo[1] = guiCreateMemo(7,6,233,127,"User panel by loler",false,GUIEditor_Tab[3]) guiMemoSetReadOnly(GUIEditor_Memo[1],true) GUIEditor_Tab[4] = guiCreateTab("Top Points",GUIEditor_TabPanel[1]) GUIEditor_Label[9] = guiCreateLabel(9,11,223,21,"Coming soon",false,GUIEditor_Tab[4]) guiLabelSetColor(GUIEditor_Label[9],255,255,255) guiLabelSetVerticalAlign(GUIEditor_Label[9],"top") guiLabelSetHorizontalAlign(GUIEditor_Label[9],"left",false) function fixv() triggerServerEvent("fixRequest", getLocalPlayer()) end addEventHandler("onClientGUIClick",GUIEditor_Button[1],fixv,false) function haystack() triggerServerEvent("haystack", getLocalPlayer()) end addEventHandler("onClientGUIClick",GUIEditor_Button[4],haystack,false) function barrel() triggerServerEvent("barrel", getLocalPlayer()) end addEventHandler("onClientGUIClick",GUIEditor_Button[3],barrel,false) function nitro() triggerServerEvent("nitro", getLocalPlayer()) end addEventHandler("onClientGUIClick",GUIEditor_Button[2],nitro,false) server side: addEvent("nitro", true) addEventHandler("nitro", getRootElement(), function() if isPedInVehicle(source) then if ( getPlayerMoney (source) >= 7000 ) then takePlayerMoney(source, 7000) addVehicleUpgrade(getPedOccupiedVehicle(source),1010) outputChatBox("Nitro Successfully added", source, 255, 255, 0, true) else outputChatBox("Not enough money.", source, 255, 0, 0, true) end else outputChatBox("You are not in a vehicle", source, 255, 0, 0, true) end end ) addEvent("fixRequest", true) addEventHandler("fixRequest", getRootElement(), function() if isPedInVehicle(source) then if ( getPlayerMoney (source) >= 20000 ) then takePlayerMoney(source, 20000) fixVehicle(getPedOccupiedVehicle(source)) outputChatBox("Vehicle Successfully Fixed", source, 255, 255, 0, true) else outputChatBox("Not enough money.", source, 255, 0, 0, true) end else outputChatBox("You are not in a vehicle", source, 255, 0, 0, true) end end ) addEvent("haystack", true) addEventHandler("haystack", getRootElement(), function() local x,y,z = getElementPosition( source ) if isPedInVehicle(source) then if ( getPlayerMoney (source) >= 99999 ) then takePlayerMoney(source, 99999) createObject ( 3374 , x , y , z ) outputChatBox("Haystack Successfully planted", source, 255, 255, 0, true) else outputChatBox("Not enough money.", source, 255, 0, 0, true) end else outputChatBox("You are not in a vehicle", source, 255, 0, 0, true) end end ) addEvent("barrel", true) addEventHandler("barrel", getRootElement(), function() local x,y,z = getElementPosition( source ) if isPedInVehicle(source) then if ( getPlayerMoney (source) >= 100000 ) then takePlayerMoney(source, 100000) createObject ( 1225 , x , y , z ) outputChatBox("Barrel Successfully planted", source, 255, 255, 0, true) else outputChatBox("Not enough money.", source, 255, 0, 0, true) end else outputChatBox("You are not in a vehicle", source, 255, 0, 0, true) end end ) greetings, Castillo
  23. hey there, i was just checking the wiki and wanted to do somthing with this text display functions, and i tryed to do somthing like if u do the cmd /text ..mytext.. will print in player screen what i typed, but i failed while trying so i will like to know if someone can give me a hand with this, server side: local myTextDisplay = textCreateDisplay () myTextItem = textCreateTextItem ( mytext, .5, .5, "low", 255, 0, 0, 150, 4.0, "center" ) function test( player, mytext ) textDisplayAddObserver ( myTextDisplay, player ) setTimer ( textDisplayRemoveObserver, 3000, 1, myTextDisplay, player ) textDisplayAddText ( myTextDisplay, myTextItem ) end addEvent("ownText", true) addEventHandler( "ownText",getRootElement(), test ) client side: function drawText ( playerSource, mytext ) if(mytext) then triggerServerEvent ( "ownText", getRootElement(), mytext ) end end addCommandHandler ( "text", drawText ) greetings
×
×
  • Create New...