Predator
Members-
Posts
18 -
Joined
-
Last visited
Everything posted by Predator
-
Dunno what's its problem but my color is random with yours..
-
Castillo's works.. Kenix's doesn't give me any errors but neither my color is black.. Thank you all for your help.
-
When trying Kenix's I get the error: WARNING: customblips\admin.Lua:28: Bad argument @ 'destroyElement' When trying myonlake's I get the error: SCRIPT ERROR: customblips\admin.Lua:4: '<' expected near 'createBlipAttachedTo'
-
Hi all, I'm trying to make a script that when an Admin spawns his blip color gets black, and when he dies/quits it(the blip) destroys.. My script: addEventHandler ( "onPlayerSpawn", getRootElement(),createBlipAttachedTo ) function createBlipAttachedTo local account = getPlayerAccount(source) if (not account or isGuestAccount(account)) then return end local accountName = getAccountName(account) if ( isObjectInACLGroup ( "user.".. accountName, aclGetGroup ( "Admin" ) ) ) then if isElement ( playerBlips[source] ) then destroyElement ( playerBlips[source] ) end playerBlips[source] = createBlip ( 0, 2, 0, 0, 0, 255, 0, 99999.0, 0 ) attachElements ( playerBlips[source], source ) end end addEventHandler ( "onPlayerQuit", getRootElement(), function() destroyElement ( playerBlips[source] ) playerBlips[source] = nil end addEventHandler ( "onPlayerWasted", getRootElement(), function() destroyElement ( playerBlips[source] ) playerBlips[source] = nil end But it doesn't work.. Error: SCRIPT ERROR: customblips\Admin.lua:3: '<' expected near 'if' Anyone can help? Thanks in advance
-
Thank you all guys! It works just fine, than you for helping.
-
Hi everyone, I have made a really simple script that spawns every player with armour, but it doesn't work and I don't know what's wrong.. function setPedArmor ( player, onPlayerSpawn ) setPedArmor ( player, 100 ) end addEventHandler ( "onPlayerSpawn", givePlayerArmor ) Anyone could help?
-
Hmm, I see my fault, thank you for the advise, and for the help with the script.
-
Ty a lot! It works! I want to ask something other too.. I tryied to do the same for stats but it kinda failed, could you fix it ? local stats = { ["DanWesson"] = {[69] = 1000, [70] = 1000, [71] = 1000, [72] = 1000, [73] = 1000, [74] = 1000, [75] = 1000, [76] = 1000, [77] = 1000, [78] = 1000, [79] = 1000, [160] = 1000}, } function changePedStat ( theSpawnpoint, theTeam ) local account = getPlayerAccount(source) if (not account or isGuestAccount(account)) then return end local accountName = getAccountName(account) if ( isObjectInACLGroup ( "user.".. accountName, aclGetGroup ( "DanWesson" ) ) ) then for stat, value in pairs(stat["DanWesson"]) do setPedstat(source, stat, value, true) end end end addEventHandler ( "onPlayerSpawn", getRootElement(), setPedStat )
-
So, here's my problem: I wan't to make a script so a player spawns with guns depending on witch ACL group he's in. I have made this script, but it doesn't work.. function giveWeaponsOnSpawn ( theSpawnpoint, theTeam ) local account = getPlayerAccount(thePlayer) if (not account or isGuestAccount(account)) then return end local accountName = getAccountName(account) if ( isObjectInACLGroup ( "user.".. accountName, aclGetGroup ( "Admin" ) ) ) then giveWeapon ( source, 1, 9999 ) giveWeapon ( source, 4, 9999 ) giveWeapon ( source, 24, 9999 ) giveWeapon ( source, 27, 9999 ) giveWeapon ( source, 32, 9999 ) giveWeapon ( source, 31, 9999 ) giveWeapon ( source, 34, 9999 ) giveWeapon ( source, 36, 9999 ) giveWeapon ( source, 39, 9999 ) giveWeapon ( source, 40, 9999 ) giveWeapon ( source, 44, 9999 ) giveWeapon ( source, 46, 9999 ) end end addEventHandler ( "onPlayerSpawn", getRootElement(), giveWeaponsOnSpawn ) When I remove all that ACL group thing the script works just fine, but when i try to add the ACL thing, I get an error: WARNING: spawnweps\DW.lua:2: Bad argument @ 'getPlayerAccount' [Expected element at argument 1, got nil] If anyone could help me with that I would really appreciate it
-
WOW! Works! Thank you a lot! You made me really happy : )
-
Wow! Thanks! Works like a charm... But, if someone can make it that when a player(guest, not logged in) joins, he spawns at ( player, -702.6533203125, 962.88671875, 12.393084526062, 90, 293, 0, 0 ), and when he logs in he dies, I would really appreciate it : ) Once again the script that worked: addEventHandler( "onResourceStart", resourceRoot, function() resetMapInfo() for _,player in ipairs( getElementsByType 'player' ) do spawn( player ) end end ) function spawn( player ) if not isElement( player ) then return end showChat( player, true ) local acc = getPlayerAccount( player ) if acc and not isGuestAccount( acc ) then if isObjectInACLGroup ( "user.".. getAccountName( acc ), aclGetGroup ( "DanWesson" ) ) then spawnPlayer ( player, -49.161193847656, -225.46385192871, 5.4296875, 90, 287, 0, 0 ) elseif isObjectInACLGroup ( "user.".. getAccountName( acc ), aclGetGroup ( "SWAT" ) ) then spawnPlayer ( player, -550.86010742188, 2594.9943847656, 53.93478012085, 90, 285, 0, 0 ) elseif isObjectInACLGroup ( "user.".. getAccountName( acc ), aclGetGroup ( "GBO" ) ) then spawnPlayer ( player, 1058.5606689453, 1279.9813232422, 10.8203125, 90, 120, 0, 0 ) end else outputChatBox( 'You are not logged in!' ) end fadeCamera( player, true ) setCameraTarget( player, player ) end addEventHandler( "onPlayerJoin", root, function( ) spawn( source ) end) addEventHandler( "onPlayerWasted", root, function( ) setTimer( spawn, 1800, 1, source ) end)
-
Well, I don't see any erros, but still it doesn't work.. The only I see when typing /debugscript 3 is this: INFO: votemanager recreate GuiElemens INFO: modloader client: Finished downloading, requesting server for mods INFO: modloader client: Replacing mods! #vehicles:4 | #weapons:0 | #skins:0
-
Still, the same shit happens.. Also what should I do with that /debugscript3 ? If you mean just type it in chat while logged in asw admin, still nothing changes..
-
Still, the same thing happens..
-
No, what currently happens is that when I die I see my dead body, the map, and the camera doing some movements getting away from the body, when i choose a location, I just spawn there..
-
Ok, then what should I do with the freeroam resource to make do what I want? Should I change a file in the freeroam resource? Sorry, I am new : )
-
Thanks for the help Castillo, indeed, now the resource is running but it's doing what I want it to.. For example when I die it shows me the map to choose a location to spawn at, instead of auto-spawning me at a specific location depending on the group, which is what I want..
-
Hi, guys. So, my problem is that: I am trying to add something more to the play resource(play/broph.lua), so when a player dies, connects, or when play resource starts spawns at different places depending on the ACL group he is in. For example, when X player dies and he's in x ACL group he spawns at (x, y, z), if the Y player dies, he should spawn at a different (x, y, z). The errors I get when I load the play resource are: But I'm pretty sure there are lots of other errors too. If anyone could possibly tell me what to do to make it work, I would really appreciate it. I have tried to do what the error says, mta documents etc. but I'm pretty noobish and new in the whole scripting thing, so I don't understand a lot. So what I have done until now is that: addEventHandler("onResourceStart", resourceRoot, function() resetMapInfo() for i,player in ipairs(getElementsByType("player")) do spawn(player) end end ) function spawn(player) local accountName = getAccountName(account) if ( isObjectInACLGroup ( "user.".. accountName, aclGetGroup ( "DanWesson" ) ) ) then if not isElement(player) then return end repeat until spawnPlayer ( player, -49.161193847656, -225.46385192871, 5.4296875, 90, 287, 0, 0) fadeCamera(player, true) setCameraTarget(player, player) showChat(player, true) end if ( isObjectInACLGroup ( "user.".. accountName, aclGetGroup ( "SWAT" ) ) ) then if not isElement(player) then return end repeat until spawnPlayer ( player, -550.86010742188, 2594.9943847656, 53.93478012085, 90, 285, 0, 0) fadeCamera(player, true) setCameraTarget(player, player) showChat(player, true) end if ( isObjectInACLGroup ( "user.".. accountName, aclGetGroup ( "GBO" ) ) ) then if not isElement(player) then return end repeat until spawnPlayer ( player, 1058.5606689453, 1279.9813232422, 10.8203125, 90, 120, 0, 0) fadeCamera(player, true) setCameraTarget(player, player) showChat(player, true) end addEventHandler("onPlayerJoin", root, function() spawn(source) end ) addEventHandler("onPlayerWasted", root, function() setTimer(spawn, 1800, 1, source) end )