Jump to content

Castillo

Retired Staff
  • Posts

    21,935
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Castillo

  1. Bajate "xampp" y lo instalas, lo inicias, y inicia mysql, apache, y no se que mas era, luego anda al explorador y escribe: localhost y selecciona phpMyAdmin.
  2. Castillo

    mysql list

    labels = 0 function crChrMenu(name1, name2) labels = labels +20 guiCreateLabel(7,labels,207,22,name1.." "..name2,false) charname = name1.." "..name2 lenght = string.len(charname) addEventHandler("onClientRender",root, function() dxDrawRectangle(7.0,20.0,60.0,74.0,tocolor(0,0,0,191),false) end ) end addEvent("onCreateCharsMenu", true) addEventHandler("onCreateCharsMenu", getRootElement(), crChrMenu) Try that (not tested).
  3. Castillo

    mysql list

    Do you mean that it just returns one record? if so, I think you should use a 'for' to loop.
  4. Castillo

    Ped Killer

    Creating a bot that would kill players could be hard, maybe check out 'slothbot' resource by Slothman. Get it from the MTA community.
  5. Well... then, if he's not from CIT, who's him? someone told him to piss me off and that's just OBIOUSLY, so if it wasn't you or anyone from CIT, who was it?
  6. outputChatBox("#00cc00Winner"..getPlayerName(player), getRootElement(),0,255,0,true)
  7. function taskagitmakas ( player, commandName, tkm ) local rand = math.random(0,2) local oynanan = bilinmeyen if tkm == tas then local oynanan = tas elseif tkm == kagit then local oynanan = kagit elseif tkm == makas then local oynanan = makas end end
  8. Nobody's going to give you an script like that, you should start learning and make it by yourself, you can ask here for help with your issues while learning.
  9. Ah, my bad, I didn't know what was you trying to do .
  10. He won't get banned from CIT because they sent him to piss me off .
  11. Peacemaker, get the fuck out of this forum, you won't get me out with your inmature insults, if I would be interested I would have sent a PM to him.
  12. Check the server log, see why it's 'going down'.
  13. If you want to have spectators list get it from here: https://community.multitheftauto.com/index.php?p= ... ls&id=1749 And for the colored names you'll have to edit race scripts.
  14. He said: "aliens have sex with women", you're Duke Nukem, you aren't a women o,O.
  15. CowTurbo, have you ever played Duke Nukem? because there aren't any zombie o,O, there are Aliens, but no zombies.
  16. Yes, if i'm right you can use global variables from a file in another (in the same resource of course).
  17. Do you have the Mysql module and the Mysql server?
  18. Do you think that's the correct way of asking for an scripter? I think none will like to work with someone who ask's thing's like that. And also, are you willing to pay him for his work?
  19. local snakeAppels = { {-720,961,11}, {-705,968,11}, {-698,954,11}, {-711,960,11}, {-722,950,11}, {-720,977,11}, {-687,965,11}, {-678,949,11}, {-664,951,11}, {-711,942,11} } -- cjSnake Marker & ColShape controller (Should only fire ONCE) -- function cjFirstSnake (thePlayer, command) local rX, rY, rZ = unpack(snakeAppels[math.random(#snakeAppels)]) theAppleMarker = createMarker ( rX, rY, rZ, "cylinder", 1.5, 255, 255, 0, 170 ) theAppleMarkerCol = createColCircle ( rX, rY, 3.0) appleBlip = createBlipAttachedTo ( theAppleMarker, 56 ) addEventHandler ( "onColShapeHit", theAppleMarkerCol, appelFirstHit ) end -- cjSnake Marker & ColShape controller (Should fire after the first PED is attached to CJ(thePlayer)) -- function cjSnake (thePlayer, command) local rX, rY, rZ = unpack(snakeAppels[math.random(#snakeAppels)]) theAppleMarker = createMarker ( rX, rY, rZ, "cylinder", 1.5, 255, 255, 0, 170 ) theAppleMarkerCol = createColCircle ( rX, rY, 3.0) appleBlip = createBlipAttachedTo ( theAppleMarker, 56 ) addEventHandler ( "onColShapeHit", theAppleMarkerCol, appelHit ) end addCommandHandler("cj-snake", cjFirstSnake) -- Should only fire ONCE! -- function appelFirstHit ( thePlayer ) local detection = isElementWithinColShape ( thePlayer, theAppleMarkerCol ) local randomMoney = math.random(50,500) local pX, pY, pZ = getElementPosition( thePlayer ) local prX, prY, prZ = getElementRotation( thePlayer ) lastPed = createPed ( 0, pX + 1, pY, pZ, prZ ) if(detection) then outputChatBox( "You found the APPLE and got $" ..randomMoney ) givePlayerMoney ( thePlayer, randomMoney ) destroyElement ( theAppleMarkerCol ) destroyElement ( theAppleMarker ) destroyElement ( appleBlip ) attachElements ( lastPed, thePlayer, 0, -0.2, 0) triggerEvent ( "loopCjSnake", getRootElement(), "" ) end end -- Should fire after the first PED is attached to CJ(thePlayer) -- function appelHit ( thePlayer ) if getElementType(thePlayer) ~= "player" then return end local detection = isElementWithinColShape ( thePlayer, theAppleMarkerCol ) local randomMoney = math.random(50,500) lastPed2 = lastPed local x, y, z = getPlayerBackPos(lastPed2) local rotz = getPedRotation(lastPed2) lastPed = createPed ( 0, x, y, z, rotz ) if(detection) then -- outputChatBox( "You found the apple and got $" ..randomMoney ) givePlayerMoney ( thePlayer, randomMoney ) destroyElement ( theAppleMarkerCol ) destroyElement ( theAppleMarker ) destroyElement ( appleBlip ) attachRotationAdjusted( lastPed, lastPed2) triggerEvent ( "loopCjSnake", getRootElement(), thePlayer ) if(lastPed) then outputChatBox ( "The new PED was created!") else outputChatBox ( "Failed to create the new PED!") end end end addEvent ( "loopCjSnake", true ) addEventHandler ( "loopCjSnake", getRootElement(), cjSnake ) function getPlayerBackPos(player) -- use this to spawn the ped behind player when its perfect use attachRotationAdjusted local rotz = getPedRotation(player) local x, y, z = getElementPosition(player) x = x + ( math.cos ( math.rad ( rotz-90 ) ) * 1.008) y = y + ( math.sin ( math.rad ( rotz-90 ) ) * 1.008) return x, y, z end -- and when they spawn perfect use this function function attachRotationAdjusted ( from, to ) -- Note: Objects being attached to ('to') should have at least two of their rotations set to zero -- Objects being attached ('from') should have at least one of their rotations set to zero -- Otherwise it will look all funny local frPosX, frPosY, frPosZ = getElementPosition( from ) local frRotX, frRotY, frRotZ = getElementRotation( from ) local toPosX, toPosY, toPosZ = getElementPosition( to ) local toRotX, toRotY, toRotZ = getElementRotation( to ) local offsetPosX = frPosX - toPosX local offsetPosY = frPosY - toPosY local offsetPosZ = frPosZ - toPosZ local offsetRotX = frRotX - toRotX local offsetRotY = frRotY - toRotY local offsetRotZ = frRotZ - toRotZ offsetPosX, offsetPosY, offsetPosZ = applyInverseRotation ( offsetPosX, offsetPosY, offsetPosZ, toRotX, toRotY, toRotZ ) attachElements( from, to, offsetPosX, offsetPosY, offsetPosZ, offsetRotX, offsetRotY, offsetRotZ ) end function applyInverseRotation ( x,y,z, rx,ry,rz ) -- Degress to radians local DEG2RAD = (math.pi * 2) / 360 rx = rx * DEG2RAD ry = ry * DEG2RAD rz = rz * DEG2RAD -- unrotate each axis local tempY = y y = math.cos ( rx ) * tempY + math.sin ( rx ) * z z = -math.sin ( rx ) * tempY + math.cos ( rx ) * z local tempX = x x = math.cos ( ry ) * tempX - math.sin ( ry ) * z z = math.sin ( ry ) * tempX + math.cos ( ry ) * z tempX = x x = math.cos ( rz ) * tempX + math.sin ( rz ) * y y = -math.sin ( rz ) * tempX + math.cos ( rz ) * y return x, y, z end Your problem: You did: attachElements ( newPed1, thePlayer, 0, -0.2, 0) but it was lastPed not newPed1, I tested ant it works.
  20. function ResourceStart() marker = createMarker ( 1449.3040771484, -2937.9020996094, 2.9447371959686, "cylinder", 1, 255, 255, 0) for i, v in ipairs(getElementsByType('player')) do setElementData(v,"all","0") setElementData(v,"tea","0") setElementData(v,"water","0") addEventHandler( "onMarkerHit", marker, MarkerHit ) addEventHandler( "onMarkerLeave", marker, markerLeave ) end end addEventHandler ( "onResourceStart", resourceRoot, ResourceStart ) function MarkerHit( hitElement, matchingDimension ) if getElementType( hitElement ) == "player" then outputChatBox( "You are now in my cafe.", hitElement, 255, 255, 0 ) outputChatBox( "If you want drink water use /water .", hitElement, 255, 255, 0 ) outputChatBox( "If you want drink tea use /tea .", hitElement, 255, 255, 0 ) addCommandHandler ( "water", water ) addCommandHandler ( "tea", tea ) end end function markerLeave( leaveElement, matchingDimension ) if getElementType( leaveElement ) == "player" then outputChatBox ( getPlayerName( thePlayer).."has left the cafe.", getRootElement(), 255, 255, 0 ) removeCommandHandler ("water", water) removeCommandHandler ("tea", tea) end end function water ( thePlayer, command ) outputChatBox( getPlayerName( thePlayer).."drunk water.", 255, 255, 0 ) setElementData ( thePlayer ,"water",tostring(tonumber(getElementData(thePlayer,"water"))+1)) end function tea ( thePlayer, command ) outputChatBox( getPlayerName( thePlayer).."drunk tea.", 255, 255, 0 ) setElementData ( thePlayer ,"tea",tostring(tonumber(getElementData(thePlayer,"tea"))+1)) end function all ( thePlayer, command ) local bira = tostring(tonumber(getElementData(thePlayer,"tea"))) local raki = tostring(tonumber(getElementData(thePlayer,"water"))) local toplam = tostring(tonumber(getElementData(thePlayer,"tea"))) + tostring(tonumber(getElementData(thePlayer,"water"))) outputChatBox( getPlayerName( thePlayer).."drunks"..toplam..".["..raki.."water"..bira.."tea]", 255, 255, 0 ) end addCommandHandler ( "all", all ) Next time use the debugscript to search for errors, you had an error. Error was: attempt to concatenate global 'tea' (a function value)
  21. Here (tested). local snakeAppels = { {-720,961,11}, {-705,968,11}, {-698,954,11}, {-711,960,11}, {-722,950,11}, {-720,977,11}, {-687,965,11}, {-678,949,11}, {-664,951,11}, {-711,942,11} } peds = {} -- cjSnake Marker & ColShape controller (Should only fire ONCE) -- function cjFirstSnake (thePlayer, command) local rX, rY, rZ = unpack(snakeAppels[math.random(#snakeAppels)]) theAppleMarker = createMarker ( rX, rY, rZ, "cylinder", 1.5, 255, 255, 0, 170 ) theAppleMarkerCol = createColCircle ( rX, rY, 3.0) appleBlip = createBlipAttachedTo ( theAppleMarker, 56 ) addEventHandler ( "onColShapeHit", theAppleMarkerCol, appelFirstHit ) end -- cjSnake Marker & ColShape controller (Should fire after the first PED is attached to CJ(thePlayer)) -- function cjSnake (thePlayer, command) local rX, rY, rZ = unpack(snakeAppels[math.random(#snakeAppels)]) theAppleMarker = createMarker ( rX, rY, rZ, "cylinder", 1.5, 255, 255, 0, 170 ) theAppleMarkerCol = createColCircle ( rX, rY, 3.0) appleBlip = createBlipAttachedTo ( theAppleMarker, 56 ) addEventHandler ( "onColShapeHit", theAppleMarkerCol, appelHit ) end addCommandHandler("cj-snake", cjFirstSnake) -- Should only fire ONCE! -- function appelFirstHit ( thePlayer ) local detection = isElementWithinColShape ( thePlayer, theAppleMarkerCol ) local randomMoney = math.random(50,500) local pX, pY, pZ = getElementPosition( thePlayer ) local prX, prY, prZ = getElementRotation( thePlayer ) newPed1 = createPed ( 0, pX + 1, pY, pZ, prZ ) if(detection) then outputChatBox( "You found the APPLE and got $" ..randomMoney ) givePlayerMoney ( thePlayer, randomMoney ) destroyElement ( theAppleMarkerCol ) destroyElement ( theAppleMarker ) destroyElement ( appleBlip ) attachElements ( newPed1, thePlayer, 0, -0.2, 0) triggerEvent ( "loopCjSnake", getRootElement(), "" ) end end -- Should fire after the first PED is attached to CJ(thePlayer) -- function appelHit ( thePlayer ) if getElementType(thePlayer) ~= "player" then return end local detection = isElementWithinColShape ( thePlayer, theAppleMarkerCol ) local randomMoney = math.random(50,500) local newPed = #peds +1 peds[newPed] = createPed ( 0, 0, 0, 0, 0 ) local npX, npY, npZ = getElementPosition (peds[newPed]) if(detection) then -- outputChatBox( "You found the apple and got $" ..randomMoney ) givePlayerMoney ( thePlayer, randomMoney ) destroyElement ( theAppleMarkerCol ) destroyElement ( theAppleMarker ) destroyElement ( appleBlip ) setElementPosition ( peds[newPed], npX, npY + 0.1, npZ ) attachElements ( peds[newPed], newPed1, npX, npY + 0.1, npZ) triggerEvent ( "loopCjSnake", getRootElement(), thePlayer ) if(peds[newPed]) then outputChatBox ( "The new PED was created!") else outputChatBox ( "Failed to create the new PED!") end end end addEvent ( "loopCjSnake", true ) addEventHandler ( "loopCjSnake", getRootElement(), cjSnake ) This creates one CJ ped every time I hit one of these 'apple' marker.
  22. I haven't tested it, so maybe there are errors indeed, but Peacemaker doesn't even know what he's talking about.
  23. Make a table with them? local snakeAppels = { {-720,961,11}, {-705,968,11}, {-698,954,11}, {-711,960,11}, {-722,950,11}, {-720,977,11}, {-687,965,11}, {-678,949,11}, {-664,951,11}, {-711,942,11} } peds = {} -- cjSnake Marker & ColShape controller (Should only fire ONCE) -- function cjFirstSnake (thePlayer, command) local rX, rY, rZ = unpack(snakeAppels[math.random(#snakeAppels)]) theAppleMarker = createMarker ( rX, rY, rZ, "cylinder", 1.5, 255, 255, 0, 170 ) theAppleMarkerCol = createColCircle ( rX, rY, 3.0) appleBlip = createBlipAttachedTo ( theAppleMarker, 56 ) addEventHandler ( "onColShapeHit", theAppleMarkerCol, appelFirstHit ) end -- cjSnake Marker & ColShape controller (Should fire after the first PED is attached to CJ(thePlayer)) -- function cjSnake (thePlayer, command) local rX, rY, rZ = unpack(snakeAppels[math.random(#snakeAppels)]) theAppleMarker = createMarker ( rX, rY, rZ, "cylinder", 1.5, 255, 255, 0, 170 ) theAppleMarkerCol = createColCircle ( rX, rY, 3.0) appleBlip = createBlipAttachedTo ( theAppleMarker, 56 ) addEventHandler ( "onColShapeHit", theAppleMarkerCol, appelHit ) end addCommandHandler("cj-snake", cjFirstSnake) addEvent ( "loopCjSnake", true ) -- Should only fire ONCE! -- function appelFirstHit ( thePlayer ) local detection = isElementWithinColShape ( thePlayer, theAppleMarkerCol ) local randomMoney = math.random(50,500) local pX, pY, pZ = getElementPosition( thePlayer ) local prX, prY, prZ = getElementRotation( thePlayer ) newPed1 = createPed ( 0, pX + 1, pY, pZ, prZ ) if(detection) then outputChatBox( "You found the APPLE and got $" ..randomMoney ) givePlayerMoney ( thePlayer, randomMoney ) destroyElement ( theAppleMarkerCol ) destroyElement ( theAppleMarker ) destroyElement ( appleBlip ) attachElements ( newPed1, thePlayer, 0, -0.2, 0) triggerEvent ( "loopCjSnake", getRootElement(), "" ) end end -- Should fire after the first PED is attached to CJ(thePlayer) -- function appelHit ( thePlayer ) local detection = isElementWithinColShape ( thePlayer, theAppleMarkerCol ) local randomMoney = math.random(50,500) peds[#peds + 1] = createPed ( 0, 0, 0, 0, 0 ) local npX, npY, npZ = getElementPosition (peds[#peds + 1]) if(detection) then -- outputChatBox( "You found the apple and got $" ..randomMoney ) givePlayerMoney ( thePlayer, randomMoney ) destroyElement ( theAppleMarkerCol ) destroyElement ( theAppleMarker ) destroyElement ( appleBlip ) setElementPosition ( peds[#peds + 1], npX, npY + 0.1, npZ ) attachElements ( peds[#peds + 1], newPed1, npX, npY + 0.1, npZ) triggerEvent ( "loopCjSnake", getRootElement(), thePlayer ) if(peds[#peds + 1]) then outputChatBox ( "The new PED was created!") else outputChatBox ( "Failed to create the new PED!") end end end addEventHandler ( "loopCjSnake", getRootElement(), cjSnake ) Not tested.
×
×
  • Create New...