Jump to content

CJGrove

Members
  • Posts

    54
  • Joined

  • Last visited

Everything posted by CJGrove

  1. Nevemind this, I got it working. It's realy silly acutly. The key was bind in an other function (original). Forgot to delete that line so. It works now thanks for evrything . Greetings CJGrove.
  2. Wait is enter not a control? It is becose it stands in the script of cdm: Copied from cdm. bindKey ( player, "enter", "down", cdm_spawn, player )
  3. Read edit2. Edit: function isguest ( ) player = getClientAccount ( source ) if isGuestAccount ( player ) then unbindKey ( player, "enter", "down", cdm_spawn ) outputChatBox ( "You need to login before you can spawn. (/login password) (/register password)", sourceAccount ) else bindKey ( player, "enter", "down", cdm_spawn ) end end addEventHandler ( "onPlayerJoin", getRootElement(), isguest ) function guestlogin () local player = getPlayerFromNick (getClientName (source)) bindKey ( player, "enter", "down", cdm_spawn ) end addEventHandler("onClientLogin",getRootElement(),guestlogin) function guestlogout () local player = getPlayerFromNick (getClientName (source)) unbindKey( player, "enter", "down", cdm_spawn ) end addEventHandler("onClientLogout",getRootElement(),guestlogout ) [12:58:02] WARNING: cdm.lua: Bad 'player' pointer @ 'unbindKey'(1) - Line: 259
  4. Error: [12:45:09] SCRIPT ERROR: ...n/MTA Server/mods/deathmatch/resources/functionscript/functionscript.lua:820: unexpected symbol near ')' [12:45:09] INFO: Loading script failed: ...n/MTA Server/mods/deathmatch/resources/functionscript/functionscript.lua:820: unexpected symbol near ')' Edit: Using this code function isguest ( ) sourceAccount = getClientAccount ( source ) if isGuestAccount ( sourceAccount ) then unbindKey ( player, "enter" ) outputChatBox ( "You need to login before you can spawn. (/login password) (/register password)", sourceAccount ) else bindKey ( player, "enter", "down", cdm_spawn, player ) end end addEventHandler ( "onPlayerJoin", getRootElement(), isguest ) function guestlogin () local player = getPlayerFromNick (getClientName (source)) bindKey ( player, "enter", "down", cdm_spawn, player ) end addEventHandler("onClientLogin",getRootElement(),guestlogin) function guestlogout () local player = getPlayerFromNick (getClientName (source)) unbindKey( player, "enter") end addEventHandler("onClientLogout",getRootElement(),guestlogout ) Getting this error: [12:50:10] WARNING: cdm.lua: Bad argument @ 'unbindKey' - Line: 259 Edit2: Using this code function isguest ( ) player = getClientAccount ( source ) if isGuestAccount ( sourceAccount ) then unbindKey ( player, "enter" ) outputChatBox ( "You need to login before you can spawn. (/login password) (/register password)", sourceAccount ) else bindKey ( player, "enter", "down", cdm_spawn, player ) end end addEventHandler ( "onPlayerJoin", getRootElement(), isguest ) function guestlogin () local player = getPlayerFromNick (getClientName (source)) bindKey ( player, "enter", "down", cdm_spawn, player ) end addEventHandler("onClientLogin",getRootElement(),guestlogin) function guestlogout () local player = getPlayerFromNick (getClientName (source)) unbindKey( player, "enter") end addEventHandler("onClientLogout",getRootElement(),guestlogout ) Getting no errors but no effect what so ever.
  5. Thanks for fast and good reply Mr.Hankey, Still got a lot to learn i gues... But were not quite there yet Using this code: function isguest ( ) sourceAccount = getClientAccount ( source ) if isGuestAccount ( sourceAccount ) then toggleControl ( source, "enter", false ) outputChatBox ( "You need to login before you can spawn. (/login password) (/register password)", sourceAccount ) else toggleControl ( source, "enter", true ) end end addEventHandler ( "onPlayerJoin", getRootElement(), isguest ) function guestlogin () toggleControl ( source, "enter", true ) end addEventHandler("onClientLogin",getRootElement(),guestlogin) function guestlogout () toggleControl ( source, "enter", false ) end addEventHandler("onClientLogout",getRootElement(),guestlogout) Getting this error: [12:04:29] WARNING: functionscript.lua: Bad 'player' pointer @ 'enableControl'(1) - Line: 826 Thanks in advance, CJGrove
  6. Hello, I tried to make a script that would it make impossible for guests to spawn. (enter is spawn button) But i got some errors but it is like this documented on wiki. script: function isguest ( playerSource ) sourceAccount = getClientAccount ( playerSource ) if isGuestAccount ( sourceAccount ) then toggleControl ( source, "enter", false ) outputChatBox ( "You need to login before you can spawn. (/login password) (/register password)", sourceAccount ) else toggleControl ( source, "enter", true ) end end addEventHandler ( "onPlayerJoin", getRootElement(), isguest ) function guestlogin () toggleControl ( source, "enter", true ) end addEventHandler("onClientLogin",getRootElement(),guestlogin) function guestlogout () toggleControl ( source, "enter", false ) end addEventHandler("onClientLogout",getRootElement(),guestlogout) Errors: [11:37:00] WARNING: functionscript.lua: Bad argument @ 'getClientAccount' - Line: 815 [11:37:00] WARNING: functionscript.lua: Bad argument @ 'isGuestAccount' - Line: 816 Please help me. Greetings CJGrove
  7. I don't get the command handler. Please explain this to me. addCommandHandler ( "GT-Refresh", unload ) Why unload while the function name is load? Greetings, CJGrove
  8. Hello all, I tried something like this but it doesn't kill the player can someone help me with this? Thanks in advance function setFriendlyFireOn ( ) for index, theTeam in ipairs ( getElementsByType("team") ) do if ( getTeamFriendlyFire ( theTeam ) == false ) then setTeamFriendlyFire ( theTeam, true ) outputChatBox ( "Friendly fire turned ON", 255, 0, 0 ) outputDebugString ( "Friendly fire turned ON", 3 ) else setTeamFriendlyFire ( theTeam, false ) outputChatBox ( "Friendly fire turned OFF", 0, 255, 0 ) outputDebugString ( "Friendly fire turned OFF", 3 ) end end end function friendlyfire ( theTeam, ammo, killer, killerweapon, bodypart ) for index, theTeam in ipairs ( getElementsByType("team") ) do if ( getTeamFriendlyFire ( theTeam ) == false ) then if ( killer ) and ( killer ~= source ) then kill = killPlayer ( killer ) if ( kill ) then outputChatBox ( "FRIENDLY FIRE BY " .. killer .. "! He has been killed.", 255, 0, 0 ) else outputDebugString ( "Player hasn't been killed", 3 ) end else outputDebugString ( "Source is killer", 3 ) end end end end function getff ( ) for index, theTeam in ipairs ( getElementsByType("team") ) do if ( getTeamFriendlyFire ( theTeam ) == false ) then outputChatBox ( "Friendly fire turned off. You will be killed when you kill your teammate.", source ) else outputChatBox ( "Friendly fire turned on. You can kill your teammate.", source ) end end end addCommandHandler ( "getff", getff ) addCommandHandler ( "setff", setFriendlyFireOn ) addEventHandler ( "onPlayerWasted", getRootElement(), friendlyfire )
  9. You can beter use give player so a player keeps his last money. addEventHandler("onPlayerSpawn", getRootElement(), function givePlayerMoney( source, 10000 ) -- gives the player $10,000 on spawn end )
  10. Think this should work? function checkName() if getClientName ( source ) =~ getPlayerUserName ( source ) then setClientName ( source, getPlayerUserName ( source ) ) end end addEventHandler ( "onPlayerJoin", getRootElement(), checkName ) This will stop them for using an other name (fake) then their username.
  11. Lol there are converters. like http://up.delux-host.com/1192573787/index.php5.
  12. Euh you could write a lua file?
  13. Just use the race map editor lol.
  14. What happens if the 10 minutes are over? I think it would be realy cool if you make 3 big explosions and start a new round. (im not sure if this is possible but: You could make the ship sink after the explosions en set all player camera's at the sinking ship.) Greetings
  15. Hello, First of all use the search thing. This is the code: function replaceModel() txd = engineLoadTXD ( "data/petrotr.txd" ) engineImportTXD ( txd, 584 ) dff = engineLoadDFF ( "data/petrotr.dff", 584 ) engineReplaceModel ( dff, 584 ) end addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), replaceModel) CLIENT SIDE!!! When you are in the server type /restart scriptname and it will load correctly I never tried this but you could: function replaceModel() txd = engineLoadTXD ( "data/petrotr.txd", 584 ) engineImportTXD ( txd, 584 ) dff = engineLoadDFF ( "data/petrotr.dff", 584 ) engineReplaceModel ( dff, 584 ) end addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), replaceModel) And then look if it works correctly when you DON'T restart the script. Greetings, CJGrove
  16. I don't know timer or command or something...?
  17. Try function replaceTheObjs() txd = engineLoadTXD ( "box.txd" ) engineImportTXD ( txd, 2918 ) dff = engineLoadDFF ( "box.dff", 2918 ) engineReplaceModel ( dff, 2918 ) createObject( 2918, -750.46569824219, 1026.3781738281, 45.267562866211 ) end addEventHandler( "onClientResourceStart", getResourceRootElement( getThisResource() ), replaceTheObjs ) Greetings, CJGrove
  18. Strange the icon doesn't show in my edited version of CDM but when i load broph it works fine. The only error i have is this one but i had this one longer [19:35:11] ERROR: Couldn't packetize argument list, invalid element specified.
  19. Yea but maybe in an other script that is always running...
  20. Hello, I have a few questions... 1. Why create a new group (acl) 2. Seconly why a new resource just put that little bit of coding in your gamemode or sidescript. And try the code Greetings, CJGrove
×
×
  • Create New...