Jump to content

pejczi

Members
  • Posts

    29
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

pejczi's Achievements

Advanced Member

Advanced Member (8/54)

0

Reputation

  1. Hello, I've got some problem with tables - i add the serial to the table and when i check if it exists there, it outputs that nope.. What's wrong over here? serials = { } function addToTable (thePlayer,command) local serial = getPlayerSerial(thePlayer) if serial then table.insert(serials,serial) outputChatBox ( " #FF0000Serial added successfuly to the table", root, 255, 255, 255, true ) end end addCommandHandler ( "addtable" , addToTable ) function checkPlayer(thePlayer, command) if serials[serial] then outputChatBox ( " #FF0000There are serials in the table", root, 255, 255, 255, true ) else outputChatBox ( " #FF0000There are no serials in the table", root, 255, 255, 255, true ) end end addCommandHandler ( "checktable" , checkPlayer )
  2. Still ain't add the object. Debugger outputs nothing.
  3. but still dunno what should be the eventHandler for this function.
  4. Hey, Recently I found out function addVehicleSirens The problem is that it gives only siren sound from vehicle instead of object on the roof + sound addVehicleSirens(source,1,2,true,true,true,false) https://wiki.multitheftauto.com/wiki/AddVehicleSirens Maybe i wrote bad integers? Any ideas for lights on the roof?
  5. It's defined function - same as "getPlayerFromNamePart" in example below : function getPlayerFromNamePart(name) if name then for i, player in ipairs(getElementsByType("player")) do if string.find(getPlayerName(player):lower(), tostring(name):lower(), 1, true) then return player end end end return false end u can use it later in next functions . Just u have to define what's "outputColoredMessage".
  6. pejczi

    Unban all

    But why? I don't want to get any nick ;o
  7. pejczi

    Unban all

    Doesn't output any message when i'm logged in and table is clear, when i'm not logged in ,it outputs "No players to unban!". And still " outputChatBox ("All players has been successfully unbanned using Pejczi's script !" , source)" is in loop. bans = {} function unBanAll ( source, command ) if ( hasObjectPermissionTo ( source , "function.removeBan", true ) ) then local bans = getBans() for i,d in ipairs ( bans ) do removeBan(d) if (removeBan(d) ) then outputChatBox ("All players has been successfully unbanned using Pejczi's script !" , source) else outputChatBox ( " You have no permission to unban all" , source ) end end else table.getn ( bans ) if #bans == 0 then outputChatBox ("No players to unban!" , source) end end end addCommandHandler ("unbanall", unBanAll) Added table, but still ain't work.
  8. pejczi

    Unban all

    function unBanAll ( source, command ) if ( hasObjectPermissionTo ( source , "function.removeBan", false ) ) then local bans = getBans() for i,d in ipairs ( bans ) do local nick = getBanNick (d) if (removeBan(d) ) then outputChatBox ("All players has been successfully unbanned using Pejczi's script !" , source) else outPutChatBox ( " You have no permission to unban all" , source ) end end table.getn ( bans ) if #bans == 0 then outputChatBox ("No players to unban!") end end end addCommandHandler ("unbanall", unBanAll) It shows as many "All players has been successfully unbanned using Pejczi's script " outputs, as there are bans , cause it's in the loop - the problem is i have no idea how to put it out of the loop. Second problem is it doesn't show "You have no permission to unban all" - it shows correctly "No players to unban" when table is empty. Any ideas ?
  9. Jesus, I forgot to put eventhandler - when I put just "onRaceStateChanging", it has blown my car before counting - when i put if if (state == "Running") , then it doesn't blow me. ////No help needed, i found out a problem. I had to put addEvent
  10. try using destroyElement But it's for race gamemode ; if the vehicle will get destroyed, then whole gamemode is getting bugged.
  11. Ok, last trouble got elminated, now i've got other - the vehicle of spectator doesn't get blown. function killTeam () local theTeam = getTeamFromName ( "SPECTATORS" ) if ( theTeam ) then local players = getPlayersInTeam ( theTeam ) for key, player in ipairs ( players ) do local theVehicle = getPedOccupiedVehicle ( player ) if ( theVehicle ) then blowVehicle ( theVehicle ) end end end end I know, that the argument of blowVehicle is invalid, but i have no idea which do I have to put in.
  12. works, thanks ! But i found out one trouble, i have to type "/spec pejczi" twice, otherwise it won't move me to the team
  13. Ok, i spotted the problem ; maximal character length of nick is 21 . function deleteTag ( source, command, thePlayer ) local spec = getPlayerFromNamePart ( thePlayer ) if ( spec ) then if getElementType ( spec ) == "player" then local oldName = getPlayerName ( spec ) setPlayerName ( spec , string.gsub ( oldName , "[s]" , "" ) ) setPlayerTeam ( spec, nil ) outputChatBox ( "Player has been removed from SPEC team" , source ) end else outputChatBox ("Unable to remove player from SPEC team" , source ) end end addCommandHandler ( "nospec" , deleteTag ) Why it removes just S, instead of ?
×
×
  • Create New...