Jump to content

Castillo

Retired Staff
  • Posts

    21,935
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Castillo

  1. Exactly, that's why I wanted you to show me the meta.xml, it's a server-side script, so it must be type="server".
  2. He meant's that, zombies by slothman... and if you are using it, can you show me your meta.xml of the script to give money on kill?
  3. Castillo

    Problems

    What's that TurboCow? getAccountName(source) o,O? also.. when you chat your nametag text is not shown in the chat without the script to do that. You have a lot of mistakes in this script. Here's what Jaysd1 wanted: function iamAdmin() local account = getPlayerAccount(source) local accountName = getAccountName(account) if isObjectInACLGroup ( "user." .. accountName, aclGetGroup ( "Sr.Admin" ) ) then setPlayerTeam (source, teamA) setPlayerName(source, "{JWORLD}"..getPlayerName(source)) ouputChatBox ("* INFO: Admin have logged in!") elseif isObjectInACLGroup ( "user." .. accountName, aclGetGroup ( "Moderator" ) ) then setPlayerName(source, "{JWORLD}"..getPlayerName(source)) setPlayerTeam (source, teamM) ouputChatBox ("INFO: Moderator have logged in!") end end addEventHandler("onPlayerLogin", getRootElement(), iamAdmin)
  4. Well, you shouldn't bump old topics, but such script to give the killer money it's easy to do. addEvent("onZombieWasted",true) addEventHandler("onZombieWasted",getRootElement(), function (killer) givePlayerMoney(killer,math.random(100,200)) end) That should work.
  5. Well, your path's are wrong... WaffeImg1 = guiCreateStaticImage(4,4,78,72,"images/DEAGLE.png",false,Waffe1) It should be: WaffeImg1 = guiCreateStaticImage(4,4,78,72,"police/duty/images/DEAGLE.png",false,Waffe1)
  6. Maybe with this way you can do that: function removeHEXOnly(oldNick,newNick) if (string.find(newNick,"#%x%x%x%x%x%x") and #newNick == 7) then outputChatBox("You can't have just colour codes in name.", source, 255, 0, 0) cancelEvent() end end addEventHandler("onPlayerChangeNick",getRootElement(),removeHEXOnly)
  7. Now I don't understand anything, you we're trying to call a function from factions resource which is only server-side from a client-side script, and now you want something totally different...
  8. Castillo

    Problems

    playerElement = your player element, is that hard to understand?
  9. And that's what you wanted, isn't it? if not, then EXPLAIN yourself better.
  10. That's because the function: isPlayerInFactionType it's only server-side in that script.
  11. Castillo

    Problems

    triggerClientEvent(playerElement,"eventName",playerElement)
  12. Jaysd1, can you stop posting without a REASON?!
  13. Castillo

    Adminlist

    function createAdminList() adminList = { } adminList["admin"] = {} adminList["super_mod"] = {} adminList["mod"] = {} adminList["junior"] = {} for k, v in ipairs(getElementsByType("player")) do if not isGuestAccount(getPlayerAccount(v)) then if isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(v)), aclGetGroup("Admin")) then table.insert(adminList["admin"], v) elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(v)), aclGetGroup("SuperModerator")) then table.insert(adminList["super_mod"], v) elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(v)), aclGetGroup("Moderator")) then table.insert(adminList["mod"], v) elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(v)), aclGetGroup("juniors")) then table.insert(adminList["junior"], v) end end end return adminList end function AdminList(sourcePlayer, command) local adminList = createAdminList() if #adminList["admin"] == 0 then outputConsole("No hay usuario De nivel 4", sourcePlayer,false ) else for k, v in ipairs(adminList["admin"]) do outputChatBox("Nivel 4: " .. getPlayerName(v), getRootElement (), 255, 0, 0, false) end end if #adminList["super_mod"] == 0 then outputConsole("No hay usuario De Nivel 3", sourcePlayer,false ) else for k, v in ipairs(adminList["super_mod"]) do outputChatBox("Nivel 3: " .. getPlayerName(v), getRootElement (), 0, 255, 0, false) end end if #adminList["mod"] == 0 then outputConsole("No hay usuarios De nivel 2", sourcePlayer,false ) else for k, v in ipairs(adminList["mod"]) do outputChatBox("Nivel 2: " .. getPlayerName(v), getRootElement (), 255, 0, 255, false) end end if #adminList["junior"] == 0 then outputConsole("No hay Juniors", sourcePlayer,false ) else for k, v in ipairs(adminList["junior"]) do outputChatBox("Nivel Junior: " .. getPlayerName(v), getRootElement (), 255, 255, 0, false) end end outputChatBox("--------------------", sourcePlayer, 0, 255, 0, false) end addCommandHandler("admins", AdminList) addCommandHandler("lvl", AdminList) addCommandHandler("lvls", AdminList) addCommandHandler("LVL", AdminList) addCommandHandler("LVLS", AdminList)
  14. Copy the code again, I was busy when I posted it, also you had an error in outputChatBox, first argument it's the TEXT.
  15. function removeHEX(oldNick,newNick) if (string.find(newNick,"#%x%x%x%x%x%x")) then outputChatBox("You can't have just colour codes in name.", source, 255, 0, 0) cancelEvent() end end addEventHandler("onPlayerChangeNick",getRootElement(),removeHEX)
  16. Well... just make these changes to the new code I gave you.
  17. Try this: function score () score2 = 0 score1 = 0 scoreDisplay = textCreateDisplay() local csscore1 = textCreateTextItem ( "Terrorist: " .. score1 .. " |" , 0.5, 0.5 ) local csscore2 = textCreateTextItem ( "Resistance: " .. score2 .. " |" , 0.5, 0.5 ) textDisplayAddText ( scoreDisplay, csscore1 ) textDisplayAddText ( scoreDisplay, csscore2 ) end addEventHandler ( "onResourceStart", getResourceRootElement(getThisResource()), score ) function showscore() textDisplayAddObserver ( scoreDisplay, source ) end addEventHandler ( "onPlayerSpawn", getRootElement(), player_Spawn )
  18. Well, we can't really help you if you don't post your full script, with just one line we can't know what you did wrong.
  19. Yes, I suposed it was going to lag a lot.
  20. randDrugMarker is a table, it's not necesary to be into the function in this case.
  21. Your code is a bit weird.... try this: local randDrugMarker = { {-720,961,12}, {-705,968,12}, {-698,954,12}, {-711,942,12} } function drugRunner (thePlayer, command) local randomX, randomY, randomZ = unpack(randDrugMarker[math.random(#randDrugMarker)]) local theDrugMarker = createMarker ( randomX, randomY, randomZ, "cylinder", 1.5, 255, 255, 0, 170 ) end addCommandHandler("drugrun", drugRunner) function markerHit ( thePlayer ) local randMoney = math.random(50,500) if(randMoney) then outputChatBox ("The Number Is:" .. tostring(randMoney)) else outputChatBox ("Value is nil!") end end addCommandHandler("a", markerHit)
  22. Client side : addEvent("getTrain", true ) function getTrain () local x, y, z = getElementPosition(getElementByID( "loco1" )) local a, b, c = getElementPosition(getElementByID( "wagon1" )) local g, h, i = getElementPosition(getElementByID( "pilot2" )) local d, e, f = getElementPosition(getElementByID( "pilot1" )) triggerServerEvent("setTrainPosition",getRootElement(),x,y,z,a,b,c,g,h,i,d,e,f) end addEventHandler("getTrain", getRootElement(), getTrain) Server side : addEvent("setTrainPosition",true) function setTrain (x,y,z,a,b,c,g,h,i,d,e,f) triggerClientEvent( "getTrain", getRootElement()) setElementPosition(loco, x, y, z, false) setElementPosition(locool, a, b, c, false) setElementPosition(pilot1, d, e, f, false) setElementPosition(pilot2, g, h, i, false) end addEventHandler("setTrainPosition",getRootElement(),setTrain) I don't know if that's what you wanted.
  23. Castillo

    C++ ?

    What part you don't understand? they are telling you that you CAN'T play in another server with edited data files, that's all, forgot about it.
×
×
  • Create New...