CJGrove
Members-
Posts
54 -
Joined
-
Last visited
About CJGrove
- Birthday 30/07/1994
Details
-
Location
EU, Netherlands
CJGrove's Achievements
Snitch (10/54)
0
Reputation
-
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.
-
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 )
-
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
-
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.
-
(Forgot what was in it.)
-
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
-
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
-
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
-
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 )
-
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 )
-
Yea but you can put it on a timer.
-
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.
-
Lol there are converters. like http://up.delux-host.com/1192573787/index.php5.
-
Euh you could write a lua file?
-
Just use the race map editor lol.