Jump to content

Castillo

Retired Staff
  • Posts

    21,935
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Castillo

  1. what i did its added the resource to acl group admins...
  2. all works fine like i wanted, thanks. just one problem that dosnt matter cause worked when i deleted somthing, this dosnt works like that O_o addCommandHandler( "reac", function( _, _, count ) WIN_WORD = generateRandomString( tonumber( count ) or 5 ); -- eg. "/reac 6" to generate 6 characters string outputChatBox("Reaction: Type '".. WIN_WORD .."' if u want to win $10000",getRootElement(),0,255,0); end, true -- restricted for admins only (you'll need to update ACL to restrict it) ); but works like this, addCommandHandler( "reac", function( _, _, count ) WIN_WORD = generateRandomString( tonumber( count ) or 5 ); -- eg. "/reac 6" to generate 6 characters string outputChatBox("Reaction: Type '".. WIN_WORD .."' if u want to win $10000",getRootElement(),0,255,0); end );
  3. Castillo

    random text

    hey there, im trying to make that if i type /reac it will just output a random word like LaRz2 and save it somewhere then when i type in chat that word it should output a message that i won... but dunno why dosnt work, here is my code so far,
  4. I guess this is what u looking for, next time search yourself https://community.multitheftauto.com/index.php?p=resources&s=details&id=232
  5. I think you arent even understanding us... i m right?
  6. so? i guess what he saying its that YOU CANT FIND ANY FREE SCRIPTER HERE! this is a help forum not scripter request/script request.
  7. thats what exactly i wont do... Why? i dont know how to set more than 1 character per player.
  8. thats what exactly i wont do... but can someone tell me why dosnt works what i did with xmlUnloadFile? the problem with account data was that i dint know how to set more than 1 character per player.
  9. Castillo

    /ss ??

    function setSkin(thePlayer,cmd,skin) skin = skin and tonumber(skin) -- skin will be "true" now if skin then -- skin=true, we are passing this setElementModel(thePlayer,skin) -- bad argument fadeCamera(thePlayer,true) end end addCommandHandler("ss", setSkin) dunno what u mean, the code works cause ive tested it.
  10. nah this one isnt cool hehe, the one of cleo its cool
  11. u should make the cleo mod where u can have a transformer
  12. Castillo

    xml problem

    hey guys, ive got a problem while adding data to a xml file, all works but i have to restart the resource to the data be refresh and i dont want it that way cause would be weird , so if someone can help me thanks Edit: solved used local root = getResourceConfig("playerdb.xml")
  13. Castillo

    /ss ??

    i made it in 3 lines function setSkin(thePlayer,cmd,skin) skin = skin and tonumber(skin) if skin then setElementModel(thePlayer,skin) fadeCamera(thePlayer,true) end end addCommandHandler("ss", setSkin)
  14. maybe checking if the player its in a vehicle? i understand that from the "checks".
  15. Thats impossible cause ive tested it before post it here check what u did wrong.
  16. somthing like this u want? addEventHandler("onClientVehicleEnter", getRootElement(), function(thePlayer, seat) if thePlayer == getLocalPlayer() then Panel_Window = guiCreateWindow(797,171,174,123,"VEHICLE PANEL",false) guiWindowSetMovable(Panel_Window,false) guiWindowSetSizable(Panel_Window,false) Engine_Label = guiCreateLabel(0.0747,0.252,0.8046,0.2195,"Engine status: Off ",true,Panel_Window) guiLabelSetColor(Engine_Label,255,255,255) guiLabelSetVerticalAlign(Engine_Label,"top") guiLabelSetHorizontalAlign(Engine_Label,"left",false) Doors_Label = guiCreateLabel(0.069,0.6829,0.8621,0.1951,"Door Status: Locked ",true,Panel_Window) guiLabelSetColor(Doors_Label,255,255,255) guiLabelSetVerticalAlign(Doors_Label,"top") guiLabelSetHorizontalAlign(Doors_Label,"left",false) Lights_Label = guiCreateLabel(0.069,0.4715,0.8046,0.2114,"Lights Status: On ",true,Panel_Window) guiLabelSetColor(Lights_Label,255,255,255) guiLabelSetVerticalAlign(Lights_Label,"top") guiLabelSetHorizontalAlign(Lights_Label,"left",false) playervehicle = getPedOccupiedVehicle ( thePlayer ) if getVehicleOverrideLights ( playervehicle ) == 2 then guiSetText ( Lights_Label, "Lights status: On " ) else guiSetText ( Lights_Label, "Lights status: Off " ) end playervehicle = getPedOccupiedVehicle ( thePlayer ) if isVehicleLocked ( playervehicle ) then guiSetText ( Doors_Label, "Door status: Locked " ) else guiSetText ( Doors_Label, "Door status: Unlocked " ) end playervehicle = getPedOccupiedVehicle ( thePlayer ) local engine1 = getVehicleEngineState ( playervehicle ) if ( engine1 == false ) then guiSetText ( Engine_Label, "Engine status: Off " ) else guiSetText ( Engine_Label, "Engine status: On " ) end end end ) function enginefunc(state) local clientPlayer = getLocalPlayer() if isPedInVehicle(clientPlayer) == true then local playerVehicle = getPedOccupiedVehicle ( clientPlayer) local engine = getVehicleEngineState ( playerVehicle ) if ( engine == false ) then setVehicleEngineState( playerVehicle, true ) guiSetText ( Engine_Label, "Engine status: On " ) else setVehicleEngineState( playerVehicle, false ) guiSetText ( Engine_Label, "Engine status: Off " ) end else outputChatBox("You are not in a vehicle",255,0,0,true) end end function lightsfunc(state) local clientPlayer = getLocalPlayer() if isPedInVehicle(clientPlayer) == true then local playerVehicle = getPedOccupiedVehicle ( clientPlayer) if ( getVehicleOverrideLights ( playerVehicle ) ~= 2 ) then setVehicleOverrideLights ( playerVehicle, 2 ) guiSetText ( Lights_Label, "Lights status: On " ) guiLabelSetColor(lbllight,0,200,0) else setVehicleOverrideLights ( playerVehicle, 1 ) guiLabelSetColor(lbllight,200,0,0) guiSetText ( Lights_Label, "Lights status: Off " ) end else outputChatBox("You are not in a vehicle",255,0,0,true) end end function doorsfunc(state) local clientPlayer = getLocalPlayer() if isPedInVehicle(clientPlayer) == true then local playerVehicle = getPedOccupiedVehicle ( clientPlayer) if isVehicleLocked ( playerVehicle ) then setVehicleLocked ( playervehicle, false ) guiSetText ( Doors_Label, "Door status: Unlocked " ) else setVehicleLocked ( playervehicle, true ) guiSetText ( Doors_Label, "Door status: Locked " ) end else outputChatBox("You are not in a vehicle",255,0,0,true) end end function bindTheKeys() bindKey ("1", "down", enginefunc) bindKey ("2", "down", lightsfunc) bindKey ("3", "down", doorsfunc) end addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), bindTheKeys) addEventHandler("onClientVehicleExit", getRootElement(), function(thePlayer, seat) if thePlayer == getLocalPlayer() then destroyElement(Panel_Window) end end )
  17. oh now works, thank you very much.
  18. WTF??!! you are checking if this is NOT 100, any other value = good (true) value!! re<100 is this what you need? can't you use? DELETE FROM table_name WHERE deaths<100 huh? i dont understand , if i remplace "if ( re ~= 100 ) then" with "if ( re re<100 ) then" just says "attempt to compare table with number"
  19. hey there, im trying to delete rows from a table in the sqlite system, the problem is that i want to check all accounts that has less 100 deaths then delete all those rows but the problem is that it deletes all rows not just the ones that has less than 100 deaths, here is my code. if someone could help me i will really appreciate, function delRows ( thePlayer ) local accountTable = getAccounts () if #accountTable == 0 then outputChatBox( "There are no accounts.", thePlayer ) else for k,accounts in ipairs (accountTable) do local re = executeSQLQuery("SELECT deaths FROM playerstbl WHERE accountname = '"..getAccountName(accounts).."'") if ( re ~= 100 ) then executeSQLDelete("playerstbl", "deaths") outputChatBox( "There are " .. #accountTable .. " with that data!", thePlayer ) end end end end addCommandHandler( "acc", delRows )
×
×
  • Create New...