Jump to content

GuyFromPast

Members
  • Posts

    33
  • Joined

  • Last visited

Everything posted by GuyFromPast

  1. # function findPlayerByName(playerPart) local pl = getPlayerFromName(playerPart) if isElement(pl) then return pl else for i,v in ipairs (getElementsByType ("player")) do if (string.find(getPlayerName(v),playerPart)) then return v end end end end function no(playerSource, command, arg1) local playerElement = findPlayerByName(arg1) if playerElement then local name = getPlayerName(playerElement) local sourceName = getPlayerName(playerSource) outputChatBox (sourceName..": No way, " ..name.." !", getRootElement(), 0, 0, 5, true) else local sourceName = getPlayerName(playerSource) outputChatBox (sourceName.." to himself: No way!", getRootElement(), 0, 0, 5, true) end end addCommandHandler ("n", no) and error ERROR: newbi-scripts/untlited 10.lua:8 bad argument #2 to 'find' (string expected, got nil) hope it help else not working
  2. Well i tryed it before.. not working thats why i asked it here maybe its because when player not found i get error in console bad argument to find blabla got nil ...
  3. ((sorry doublepost )) bah ur probably sick of helping me already :@ but i need one more thing that i cant handle how to "else" like if player not found then it says outputChatBox("blabla to himselfblabla")
  4. Um.. not working but thanks for trying to help me ok i try to make example because my english suck i wanna do this command (ur full name is #ff00ffvarez) i have to type /n #ff00ffvarez but i want to make it easier.. like /n var and it do same thing function no( playerSource, command, elephant ) local horse = getPlayerFromName ( elephant ) if ( horse ) then local egg = getPlayerName(playerSource) outputChatBox (egg.." No way, " ..elephant.." !", getRootElement(), 0, 0, 5, true ) end end addCommandHandler ( "n", no )
  5. Ok i started all again and finally got it working but theres only one problem.. how to make getplayerfromname working like when i type /n var then it understand that i mean varez .. right now i have to type /n #00ff00varez for this .. any tips ?
  6. function no(player, cmd) local player = getLocalPlayer() outputChatBox ( "#ff0000No Way ".. string.stripColourCodes(getPlayerName(player)) .. "!", 24, 73, 122,true) end addCommandHandler("n", no) function string.stripColourCodes(s) return type(s) == 'string' and string.gsub(s,'#%x%x%x%x%x%x','') or s end I need help with that script Im afraid im getting only bad words here because i have readed other topic and yeah.. anyways i need script for example when i type /n Varez then it says No way, Varez or /n p50 then it says No way, p50 I have readed whole wiki and this is all what i got there
×
×
  • Create New...