Jump to content

CJGrove

Members
  • Posts

    54
  • Joined

  • Last visited

Everything posted by CJGrove

  1. Did you used the good coordinates?
  2. I'm using this script but it add an helmet to my player when it's on a NRG but it doesn't remove it but its output is: Helm removed. function addHelmetOnEnter ( vehicle, seat, jacked ) if ( getVehicleID ( vehicle ) == 522 ) then clothes = addPlayerClothes ( source, "moto", "moto", 16 ) end end function removeHelmetOnExit ( vehicle, seat, jacked ) if ( getVehicleID ( vehicle ) == 522 ) then clothesremove = removePlayerClothes ( source, 16 ) if ( clothesremove ) then outputChatBox ( "Helm removed.", source, 0, 255, 0) else outputChatBox ( "Helm NOT removed.", source, 255, 0, 0) end end end addEventHandler ( "onPlayerVehicleExit", getRootElement(), removeHelmetOnExit ) addEventHandler ( "onPlayerVehicleEnter", getRootElement(), addHelmetOnEnter )
  3. Damn offcourse you cant see anything becose you didn't create the object?
  4. Hi guys, Is there a way to replace a sound with for an example an alarm sound? Like sound 15 or something is replaced by an other custom sound (say: alarm.mp3)? Greetings, CJGrove
  5. Like instead of function use the resource name or what?
  6. CJGrove

    Wrong script

    I can't see it now im sorry...
  7. CJGrove

    Wrong script

    I eddited try the code standing there now... (Oh jeah i tested it and i get no errors.)
  8. I think its the fault of previeuw 2 at first it worked fine....
  9. Got the same thing with my edit from FR.
  10. CJGrove

    Wrong script

    Try function startMap(startedMap) local mapRoot = getResourceRootElement(startedMap) local players = getElementsByType("player") fadeCamera ( thePlayer, false, 1.0, 0, 0, 0 ) for key, player in pairs(players) do local spawn = spawns[math.random(1, #spawns)] local posX = getElementData(spawn, "posX") local posY = getElementData(spawn, "posY") local posZ = getElementData(spawn, "posZ") local angle = getElementData(spawn, "angle") spawnPlayer(player, posX, posY, posZ, angle) end end addEventHandler ( "onGamemodeMapStart", getRootElement(), startMap )
  11. I made a /admingivecash command it's protected so don't worrry thanks Jumba' for helping me with that part... The command is: /admingivecash playername ammount Script.lua function admingivecash ( source, commandName, player2nick, ammount ) acl = yourresourcename.admingivecash local player2 = getPlayerFromNick ( player2nick ) if ( player2 ) then if ( ammount ~= "" and ammount ~= nil ) then if ( hasObjectPermissionTo ( source, acl, false ) ) then if ( hasObjectPermissionTo ( getThisResource (), acl, true ) ) then setmoney = givePlayerMoney ( player2, ammount ) else outputChatBox ( "Admin give cash: The resource is not able to give cash to players. Please give this resource access to '" .. acl .. "' in the ACL to use this function.", source ) end setmoney = givePlayerMoney ( player2, ammount ) else outputChatBox ( "Admin give cash: You don't have permissions to use this command.", source ) end if ( setmoney ) then outputChatBox ( "Money given to " .. player2nick .. "", source , 0, 255, 0 ) else outputChatBox ( "Money was NOT given to " .. player2nick .. "", source, 255, 0, 0) end end else outputChatBox ( "Player can't be found or there is non enterd.", source, 255, 0, 0) end end addCommandHandler ("admingivecash", admingivecash ) put this in your acl.xml <acl name="aGiveCash"> <right name="yourresourcename.admingivecash" access="true"/> </acl> and put this in your acl.xml on the group (example admin) if you want more than 1 group to use this command then you need to add this code on all groups that you want the code to use. <acl name="aGiveCash"/> Greetings, CJGrove Edit: Now I see i didn't make that you can type a playername please be patientce... Edit2: Added player2 fuction the new command is now: /admingivecash playername ammount Edit3: Using eAi's method Edit4: Lol forgot the command handler added it now.
  12. I'm getting an error now -.-' [21:16:59] WARNING: command.lua: Bad argument @ 'hasObjectPermissionTo' - Line: 483 stupid script... line 483 would be: if ( hasObjectPermissionTo ( playerSource, "function.admingivecash", false ) ) then Edit: error fixed it's working now thank you i used playerSource instead of source so... i'm going to post this as a snippet now...
  13. I scripted this but it doesn't work. It says that i dont have the rights but i have added this and this on moderator on the acl file... function admingivecash ( source, commandName, ammount ) local playeraccount = getClientAccount ( source ) if ( playeraccount ) then if ( ammount ~= "" and ammount ~= nil ) then if ( hasObjectPermissionTo ( playerSource, "function.admingivecash", false ) ) then if ( hasObjectPermissionTo ( getThisResource (), "function.admingivecash", true ) ) then setmoney = setPlayerMoney ( source, ammount, 0 ) else outputChatBox ( "Admingivecash: The admin resource is not able to give cash to players. Please give this resource access to 'function.admingivecash' in the ACL to use this function.", playerSource ) end else outputChatBox ( "Admingivecash: You don't have permissions to use this command.", playerSource ) end if ( setmoney ) then outputChatBox ( "Money set!", source , 66, 237, 251 ) else outputChatBox ( "Money was NOT set!", source , 66, 237, 251 ) end end end end
  14. Don't know if this works but you can try Rember! This is a CLIENT SIDE function so you need to use this in your meta file! function customObj () txd_obj = engineLoadTXD ( "riot_shield.txd" ) engineImportTXD ( txd_obj, 1337 ) col_obj = engineLoadCOL ( "riot_shield.col" ) engineImportCOL ( col_obj, 1337 ) dff_obj = engineLoadDFF ( "riot_shield.dff", 1337 ) engineReplaceModel ( dff_obj, 1337 ) end addEventHandler ( "onResourceStart", getRootElement(), customObj )
  15. Try something like this (taking money as an example) function save ( source ) local playeraccount = getClientAccount ( source ) if ( playeraccount ) then local playermoney = getPlayerMoney ( source ) save = setAccountData ( playeraccount, "money", playermoney) if( save ) then outputChatBox ( "TEST: saved succesfull.", source , 66, 237, 251 ) else outputChatBox ( "TEST: didnt save... ", source , 66, 237, 251 ) end end end addEventHandler ( "onPlayerQuit", getRootElement ( ), save )
  16. This works.... function save ( source ) local playeraccount = getClientAccount ( source ) if ( playeraccount ) then leukhe = "leuk he" save = setAccountData ( playeraccount, "test", leukhe) if( save ) then outputChatBox ( "TEST: saved succesfull.", source , 66, 237, 251 ) else outputChatBox ( "TEST: didnt save... ", source , 66, 237, 251 ) end end end
  17. I have no idea of this works but you can try right? function replaceModel() local playername = getClientName ( source ) if ( playername ) then outputChatBox ( "--> " .. thePlayerName .. " your custom models have been installed!" , source, 0, 255, 0 ) playSoundFrontEnd ( source, 46 ) end txd = engineLoadTXD ( "models/bmx.txd", 481 ) engineImportTXD ( txd, 481 ) dff = engineLoadDFF ( "models/bmx.dff", 481 ) engineReplaceModel ( dff, 481 ) txd = engineLoadTXD ( "models/zr350.txd", 477 ) engineImportTXD ( txd, 477 ) dff = engineLoadDFF ( "models/zr350.dff", 477 ) engineReplaceModel ( dff, 477 ) end addCommandHandler ( "cmodels", replaceModel)
  18. Try to make for evry custom vehicle a new resoucre and load them resource for resource
  19. yes i have the same problem, it is not so nice will this fixed, so i can build my gamemode with new vehicles and this problem is in the future away? I hope... this is still a preview so... We will wait...
  20. Thats a known problem with custom vehicles you are sitting in the middle of the vehicle.
  21. There is much confuse about this therefore I thought I just start a new topic and I give the code with it. Thanks to kevuwk It is posible if the car is strange white strips and stuff. Then you need to stop and start the script while in the server. Change the green text. carname.lua function replaceModel() txd = engineLoadTXD ( "[color=#008000]name.txd[/color]" ) engineImportTXD ( txd, [color=#008000]CAR ID[/color]) dff = engineLoadDFF ( "[color=#008000]name.dff[/color]", [color=#008000]CAR ID[/color]) engineReplaceModel ( dff, [color=#008000]CAR ID[/color]) end addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), replaceModel) meta.xml <meta> <info author="kevuwk" name="Custom Vehicle" version="1" type="script" /> <script src="[color=#008000]carname.lua[/color]" type="client"/> <file src="[color=#008000]name.dff[/color]" /> <file src="[color=#008000]name.txd[/color]" /> </meta> Sorry for my bad English
  22. Stop and start the script when you'r in the server then it loads good.
×
×
  • Create New...