Jump to content

Castillo

Retired Staff
  • Posts

    21,935
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Castillo

  1. Hey i was testing a game mode with the amx and all worked fine but i get kicked and reason says "possible bot detected [iD:1] somthing like this, someone know why? and how to fix it. Thanks
  2. well i think this event is only server-side: addEventHandler( "onMarkerHit", TruckerStartMarker, MarkerHit )
  3. ok, i fixed your code now it works i ve tested it 10 times, here is code: client-side function starttruckmission_func () TruckerStartMarker = createMarker (-360.84088134766, 1190.403076171, 18.342208862305, "cylinder", 6, 255, 0, 0, 150 ) TruckerEndeMarker = createMarker (834.25341796875, 866.51782226563, 11.092173576355, "cylinder", 6, 255, 0, 0, 150 ) end addEvent ( "starttruckmission", true ) addEventHandler ( "starttruckmission", getRootElement(), starttruckmission_func ) function MarkerHit( hitElement, matchingDimension ) if hitElement== getLocalPlayer() then outputChatBox( "in the marker TruckerStartMarker" ) end end addEventHandler( "onClientMarkerHit", getRootElement(), MarkerHit ) server-side truck = createVehicle( 455, -138.103515625, 1084.078125, 20.312187194824) addEventHandler( 'onPlayerVehicleEnter', getRootElement(), function ( theVehicle, seat, jacked ) if ( theVehicle == truck) then if ( PlayerJob[source] == 2 ) then triggerClientEvent( source, "starttruckmission", getRootElement()) else removePedFromVehicle ( source ) outputChatBox( "Trucker: Nur unsere Angestellten können dieses Fahrzeug benutzen!", source, 255, 0, 0 ) end end end)
  4. i mean that line wasnt in code, im wrong?
  5. I got a question what is this line? what it checks, i mean where is the truck called "truck"? if ( theVehicle == truck) then
  6. My question is if u dont know how to use this "things" just click that link and learn how to use it.
  7. if i understand u want to create a image or a gui whatever, why u dont use "guieditor"?
  8. ok, i fixed those warnings. function Script_onResourceLoad ( resource ) if ( resource == getThisResource() ) then -- for each player already in the server for index, player in getElementsByType ( "player" ) do -- binds the "i"-key to our function "modeIO" bindKey ( player, "i", "down", "modeIO" ) end end end addEventHandler ( "onResourceStart", getRootElement(), Script_onResourceLoad ) function Script_onPlayerJoin () -- binds the "i"-key to our function "modeIO" bindKey ( source, "i", "down", "modeIO" ) end addEventHandler ( "onPlayerJoin", getRootElement(), Script_onPlayerJoin ) function modeIO ( source, key, keyState ) -- function toggles the cursor if isCursorShowing ( source ) then -- if cursor was already showing: showCursor ( source, false ) -- hide it else -- if it wasn't showing: showCursor ( source, true ) -- show it end end function Script_onPlayerClick ( key, keyState, element, x, y, z ) if keyState == "up" then return -- ignore if the button was released end end addEventHandler ( "onPlayerClick", getRootElement(), Script_onPlayerClick ) if key == "left" then -- on a left mousebutton -- destroy his teleport point, if any destroyElement ( getElementData ( source, "teleport" ) ) -- create a normal cylinder marker local marker = createMarker ( x, y, z, "cylinder", 2, 0, 255, 0, 50 ) -- mark the cylinder as our "teleport" type setElementData ( marker, "type", "teleport" ) -- link the creator (player) to the marker, and vice versa setElementData ( source, "teleport", marker ) setElementData ( marker, "owner", source ) elseif key == "right" then -- on a right mousebutton -- destroy his destination point, if any destroyElement ( getElementData ( source, "destination" ) ) -- create a glowing corona local marker = createMarker ( x, y, z+1, "corona", 1, 0, 255, 255, 50 ) -- mark the corona as our "destination" type setElementData ( marker, "type", "destination" ) -- link the creator (player) to the marker, and vice versa setElementData ( source, "destination", marker ) setElementData ( marker, "owner", source ) elseif key == "middle" then -- on a middle mousebutton -- teleport the player to whereever he clicked setElementPosition ( source, x, y, z+1 ) end function Script_onMarkerHit ( player ) -- if the marker is a teleport point, proceed if getElementData ( source, "type" ) == "teleport" then -- get the owner linked to the "teleport" type marker local owner = getElementData ( source, "owner" ) -- get the destination point linked to the owner local destination = getElementData ( owner, "destination" ) -- if the destination point exists, proceed if destination then -- get the "destination" marker's position local x, y, z = getElementPosition ( destination ) -- finally, warp the player there setElementPosition ( player, x, y, z ) end end end addEventHandler ( "onMarkerHit", getRootElement(), Script_onMarkerHit ) function Script_onPlayerQuit ( reason ) --destroy his teleport point, if any destroyElement ( getElementData ( source, "teleport" ) ) -- destroy his destination point, if any destroyElement ( getElementData ( source, "destination" ) ) end addEventHandler ( "onPlayerQuit", getRootElement(), Script_onPlayerQuit ) but there is a error in line 4, the error: attempt to call a table value
  9. this line: repeat until spawnPlayer ( player, 369.77865600586+math.random(1), -2036.4565429688, 7.671875, 0, math.random(0,1) ) edit that cords with your new cords and will work.
  10. I had this error before, the players will get rights for nothing cause the panel wont work, i forgot how i fixed it.
  11. yeah it works it taked me a while to get it working but worked and now i can run samp gamemodes etc Edit: after some test i wanted to get some game modes running and filescripts but i get errors and them dont loads this are the errors: Create3DTextLabel Delete3DTextLabel ShowPlayerDialog SetPlayerFightingStyle SetPlayerSkillLevel Attach3DTextLabelToPlayer IsPlayerInRangeOfPoint Update3DTextLabelText SetPlayerDrunkLevel DisableNameTagLOS IsPlayerNPC those are the errors.
  12. Im also making a role play game mode with lot of features, but im very busy with real life stuff too, so i cant help u.
  13. I dont understand what u realy trying to do, why just u dont make a function to save everything? i have did it for you, this works. -- Based Parts and/Or whole from Icedsun's Login GUI (logingui) by icedsun AND login_register By Dr4x -- Money System added by Kevin --Default spawn location, if you wish to use one... --local spawnX = 1959 --local spawnY = -1714 --local spawnZ = 17 --Default welcome messages... local welcomeMessageNewUser = "Welcome to our server!" local welcomeMessageReturningUser = "Welcome back to the server!" function on4XLogin ( player, user, pass ) local account = getAccount ( user, pass ) if ( account ~= false ) then if (logIn ( player, account, pass ) == true) then triggerClientEvent ( "hideLoginWindow", getRootElement()) --spawnPlayer(client,spawnX,spawnY,spawnZ) fadeCamera(client,true) outputChatBox(welcomeMessageReturningUser,client) else outputChatBox ( "Login error!", player, 255, 255, 0 ) -- Output they got the details wrong. end else outputChatBox ( "Wrong username or password!", player, 255, 255, 0 ) -- Output they got the details wrong. end end addEvent( "on4XLogin", true ) addEventHandler( "on4XLogin", getRootElement(), on4XLogin ) function on4XRegister ( player, user, pass, email ) local account = getAccount ( user, pass ) if ( account ~= false ) then if (logIn ( player, account, pass ) == true) then triggerClientEvent ( "hideLoginWindow", getRootElement()) else outputChatBox ( "Login error!", player, 255, 255, 0 ) -- Output they got the details wrong. end else account = addAccount ( user, pass ) setAccountData ( account, "email", email) setAccountData ( account, "acct.money","250") if (logIn ( player, account, pass ) == true) then triggerClientEvent ( "hideLoginWindow", getRootElement()) spawnPlayer(client,spawnX,spawnY,spawnZ) setPlayerMoney ( client, "250" ) fadeCamera(client,true) outputChatBox(welcomeMessageNewUser,client) else outputChatBox ( "Register/Login error!", player, 255, 255, 0 ) -- Output they got the details wrong. end end end addEvent( "on4XRegister", true ) addEventHandler( "on4XRegister", getRootElement(), on4XRegister ) function removePlayerHandler() kickPlayer(source) end addEvent("removePlayer",true) addEventHandler("removePlayer",getRootElement(),removePlayerHandler) function playerLogin (thePreviousAccount, theCurrentAccount, autoLogin) if not (isGuestAccount (getPlayerAccount (source))) then local accountData = getAccountData (theCurrentAccount, "acct.money") if (accountData) then local playerMoney = getAccountData (theCurrentAccount, "acct.money") local playerX = getAccountData (theCurrentAccount, "cords-x") local playerY = getAccountData (theCurrentAccount, "cords-y") local playerZ = getAccountData (theCurrentAccount, "cords-z") local playerInt = getAccountData (theCurrentAccount, "int") local playerDim = getAccountData (theCurrentAccount, "dim") spawnPlayer (source, playerX, playerY, playerZ +1, 0, playerInt, playerDim) setPlayerMoney (source, playerMoney) setCameraTarget (source, source) fadeCamera(source, true, 2.0) else spawnPlayer (source, 1962.2475585938, -1674.1062011719, 15.96875, 0, math.random (0, 288), 0, 0 ) setCameraTarget (source, source) fadeCamera(source, true, 2.0) end end end addEventHandler ("onPlayerLogin", getRootElement(), playerLogin) function onQuit (quitType, reason, responsibleElement,thePreviousAccount) if not (isGuestAccount (getPlayerAccount (source))) then account = getPlayerAccount (source) if (account) then local x,y,z = getElementPosition (source) setAccountData (account, "acct.money", tostring (getPlayerMoney (source))) setAccountData (account, "cords-x", x) setAccountData (account, "cords-y", y) setAccountData (account, "cords-z", z) setAccountData (account, "int", getElementInterior (source)) setAccountData (account, "dim", getElementDimension (source)) end end end addEventHandler ("onPlayerQuit", getRootElement(), onQuit)
  14. ok well im reading what u did and first u forgot to add a "end" thats why says is not added serverside, here is new code, im trying to fix your money thing -- Based Parts and/Or whole from Icedsun's Login GUI (logingui) by icedsun AND login_register By Dr4x -- Money System added by Kevin --Default spawn location, if you wish to use one... local spawnX = 1959 local spawnY = -1714 local spawnZ = 17 --Default welcome messages... local welcomeMessageNewUser = "Welcome to our server!" local welcomeMessageReturningUser = "Welcome back to the server!" function on4XLogin ( player, user, pass, thePreviousAccount, theCurrentAccount ) local account = getAccount ( user, pass ) if ( account ~= false ) then if (logIn ( player, account, pass ) == true) then triggerClientEvent ( "hideLoginWindow", getRootElement()) local playermoney = getAccountData ( account, "acct.money" ) setPlayerMoney ( client, playermoney ) spawnPlayer(client,spawnX,spawnY,spawnZ) fadeCamera(client,true) outputChatBox(welcomeMessageReturningUser,client) else outputChatBox ( "Login error!", player, 255, 255, 0 ) -- Output they got the details wrong. end else outputChatBox ( "Wrong username or password!", player, 255, 255, 0 ) -- Output they got the details wrong. end end addEvent( "on4XLogin", true ) addEventHandler( "on4XLogin", getRootElement(), on4XLogin ) function on4XRegister ( player, user, pass, email ) local account = getAccount ( user, pass ) if ( account ~= false ) then if (logIn ( player, account, pass ) == true) then triggerClientEvent ( "hideLoginWindow", getRootElement()) else outputChatBox ( "Login error!", player, 255, 255, 0 ) -- Output they got the details wrong. end else account = addAccount ( user, pass ) setAccountData ( account, "email", email) setAccountData ( account, "acct.money","250") if (logIn ( player, account, pass ) == true) then triggerClientEvent ( "hideLoginWindow", getRootElement()) spawnPlayer(client,spawnX,spawnY,spawnZ) fadeCamera(client,true) outputChatBox(welcomeMessageNewUser,client) else outputChatBox ( "Register/Login error!", player, 255, 255, 0 ) -- Output they got the details wrong. end end end addEvent( "on4XRegister", true ) addEventHandler( "on4XRegister", getRootElement(), on4XRegister ) function removePlayerHandler() local playeraccount = getPlayerAccount ( source ) local playermoney = getPlayerMoney ( source ) setAccountData ( playeraccount, "acct.money", source ) kickPlayer(source) end addEvent("removePlayer",true) addEventHandler("removePlayer",getRootElement(),removePlayerHandler) btw why just u dont make a second function to save the player money?
  15. can u be a bit more expecific? i just understand that u cant create the object cause your code isnt good, this creates the atm createObject ( 2942, 1928.58,-1779.44, 13.54, 0, 0, 180)
  16. Castillo

    Bug or what?

    must be your other script parts because this code works i tested it.
  17. Castillo

    Bug or what?

    are u sure? cause i tryed it and does it what it says, "Boo" that says when i enter in the marker. the script its server-side
  18. Castillo

    Bug or what?

    indJuodas = createMarker(216.9921875, 79.0078125, 1004.0390625, "cylinder", 1.5, 1, 1, 1) setElementInterior(indJuodas,6) function markerHit() if ( source == indJuodas ) then outputChatBox("Boo") end end addEventHandler ("onMarkerHit", getRootElement(), markerHit) this should work
  19. Castillo

    set nick

    thanks xbost, i wont get the script done i wanna learn miself
  20. Castillo

    set nick

    i forgot already what i tryed with "hitPlayer" but anyway now is fixed and thanks to us. now can someone tell me how to use setPlayerName using a guiEdit?
  21. Castillo

    set nick

    Thanks guys now works
  22. Castillo

    set nick

    u mean that this line should be like this? because i got same problem, so if u can be a bit more expecific. function playerLoginCheckSkin (hitPlayer,thePreviousAccount, theCurrentAccount, autoLogin)
  23. Castillo

    set nick

    ok well i did a account data but dont works it says bad argument when setAccountData and getAccountData when a player login, here is my code. function playerLoginCheckSkin (hitPlayer,thePreviousAccount, theCurrentAccount, autoLogin) local accountData = getAccountData (theCurrentAccount, "rpg-skins") if not (accountData) then skin = setAccountData (theCurrentAccount, "rpg-skins", 15) triggerClientEvent ("showWin", getRootElement(), hitPlayer) if (accountData) then triggerClientEvent ("dontShowWin", getRootElement(), hitPlayer) end end end addEventHandler ("onPlayerLogin", getRootElement(), playerLoginCheckSkin)
  24. Castillo

    set nick

    the window is a skin selector window, and i want only 1 time show it to the player cause with that way nobody will use the skin shop and i dont like that idea, so i wanted to show one time the select window to every new player in server.
  25. Castillo

    set nick

    hi, im trying to get the name from a edit then setPlayerName from that edit, how would i do that? edit: also how i can do to show a window only one time to every new player, i mean when a player already saw that window he wont get it again on next time. i hope someone understand what i mean sorry for bad english
×
×
  • Create New...