xeon17 Posted January 22, 2014 Share Posted January 22, 2014 I'm working at a base system , but i wanna crate when extample FsN have Area 51 , the radar area of Area 51 get color of FsN gang then the FsN gang spawn in area 51 , after extample WANTEDS buy the Area 51 and the Area 51 radar area get the WANTEDS color and WANTEDS gang spawn in Area 51 , can someone help me radararea2 = createRadarArea( 110.91990, 1800.89435, 200, 145, 255, 255, 255, 225 ) createBlip(279.40317, 1831.25439, 7.72656,62) marker2 = createMarker(298.98865, 1815.90613, 3.71094,"cylinder",2,0,0,255,255) addCommandHandler ( "comprar51", function ( player ) local playerTeam = getPlayerTeam ( player ) if ( playerTeam ) then local r, g, b = getTeamColor ( playerTeam ) if(isElementWithinMarker(player,marker2)) then setRadarAreaColor ( radararea2, r, g, b, 155 ) local money = getPlayerMoney ( player ) if ( money >= 1000000 ) then takePlayerMoney ( player, 1000000 ) local color = getTeamColor ( playerTeam ) outputChatBox ( "#FFF000 [bASE] #FF0000 Sua gang comprou a base #00FF00 Area 51!", player, 0, 0, 0, true ) end end end end ) addEventHandler("onMarkerHit", marker2, function (player) outputChatBox ( "#FFF000 [bASE] #FF0000 Para comprar a base digita #00FF00 /comprar51 (1000000$)", player, 0, 0, 0, true) end ) My friend said me i need add something like this , but i no have idea how this should work function getSpawnPoint(player) local x, y, z if(getElementData(player, "isInGang")) then x, y, z = getBaseSpawnpoint(player) if(not x or not y or not z) then x, y, z = getGangZoneSpawnpoint(player) if(not x or not y or not z) then x, y, z = getRandomSpawnPoint(player) end end end return x, y, z end Or maybe something like this : radararea = createRadarArea( 110.91990, 1800.89435, 200, 145, 255, 255, 255, 225 ) function onSpawn ( player ) playerTeam = getPlayerTeam ( player ) if ( playerTeam ) then local r, g, b = getTeamColor ( playerTeam ) if getRadarAreaColor ( radararea ) == r, g, b then setElementPosition ( player, 298.98865, 1815.90613, 3.71094 ) end end addEventHandler ( "onPlayerSpawn", player, onSpawn ) Link to comment
Moderators IIYAMA Posted January 22, 2014 Moderators Share Posted January 22, 2014 local mySpawnTable = { {0,0,0}, -- fill in pls..... {0,0,0}, --<-- {0,0,0} -- <-- } function makePlayerSpawn (player) local spawnPoint = mySpawnTable[math.random(#mySpawnTable)] -- random spawnpoint spawnPlayer(player,spawnPoint[1],spawnPoint[2],spawnPoint[3]) end You can decide when he should spawn, that is up to you. Link to comment
xeon17 Posted January 23, 2014 Author Share Posted January 23, 2014 I no understand much about table , realy nothing.. Area 51 Spawnpoint 1 > 331.06286621094, 1855.9083251953, 7.828125 Area 51 Spawnpoint 2 > 216.45199584961, 1822.6893310547, 6.4140625 Area 51 Spawnpoint 3 > 211.66558837891, 1810.6231689453, 21.8671875 Normall Spawnpoint 1 > 2171.90625, 1392.59765625, 10.8203125 Normall Spawnpoint 2 > 2265.3674316406, 2398.3068847656, 10.8203125 Normall Spawnpoint 3 > 2361.689453125, 2070.2077636719, 10.671875 Link to comment
xeon17 Posted January 23, 2014 Author Share Posted January 23, 2014 Any answer please ? i no understand this Link to comment
Moderators IIYAMA Posted January 23, 2014 Moderators Share Posted January 23, 2014 local mySpawnTable = { {331.06286621094, 1855.9083251953, 7.828125}, -- fill in pls..... {216.45199584961, 1822.6893310547, 6.4140625}, --<-- {211.66558837891, 1810.6231689453, 21.8671875} -- <-- } Seriously was that so hard? By just filling it in..... If you don't understand it, then you know how to solve that problem. And it starts with: L . . R . . NG Link to comment
xeon17 Posted January 23, 2014 Author Share Posted January 23, 2014 I'm learning i do my beast but some things i no understand , you are scripter much years , me only 1 mounth . And now i have the table but how i can set when player have area 51 then he spawn there.. with this ? function getSpawnPoint(player) local x, y, z if(getElementData(player, "isInGang")) then x, y, z = getBaseSpawnpoint(player) if(not x or not y or not z) then x, y, z = getGangZoneSpawnpoint(player) if(not x or not y or not z) then x, y, z = getRandomSpawnPoint(player) end end end return x, y, z end or this radararea = createRadarArea( 110.91990, 1800.89435, 200, 145, 255, 255, 255, 225 ) function onSpawn ( player ) playerTeam = getPlayerTeam ( player ) if ( playerTeam ) then local r, g, b = getTeamColor ( playerTeam ) if getRadarAreaColor ( radararea ) == r, g, b then setElementPosition ( player, 298.98865, 1815.90613, 3.71094 ) end end addEventHandler ( "onPlayerSpawn", player, onSpawn ) Link to comment
Moderators IIYAMA Posted January 23, 2014 Moderators Share Posted January 23, 2014 when do you want him to spawn? P.s: the code you are showing to me is useless in your case. Link to comment
xeon17 Posted January 23, 2014 Author Share Posted January 23, 2014 I crated a base system with 10 other bases , i seen in 1 server when some team buy a base then they spawn there , their scripter given me the frist code . If the radar area have color of the player gang then that gang spawn there. my base system : radararea2 = createRadarArea( 110.91990, 1800.89435, 200, 145, 255, 255, 255, 225 ) createBlip(279.40317, 1831.25439, 7.72656,62) marker2 = createMarker(298.98865, 1815.90613, 3.71094,"cylinder",2,0,0,255,255) addCommandHandler ( "comprar51", function ( player ) local playerTeam = getPlayerTeam ( player ) if ( playerTeam ) then local r, g, b = getTeamColor ( playerTeam ) if(isElementWithinMarker(player,marker2)) then setRadarAreaColor ( radararea2, r, g, b, 155 ) local money = getPlayerMoney ( player ) if ( money >= 1000000 ) then takePlayerMoney ( player, 1000000 ) local color = getTeamColor ( playerTeam ) outputChatBox ( "#FFF000 [bASE] #FF0000 Sua gang comprou a base #00FF00 Area 51!", player, 0, 0, 0, true ) end end end end ) addEventHandler("onMarkerHit", marker2, function (player) outputChatBox ( "#FFF000 [bASE] #FF0000 Para comprar a base digita #00FF00 /comprar51 (1000000$)", player, 0, 0, 0, true) end ) A little photo , look the radar area , it have color of players gang and the gang members spawn in their radar area (base) Link to comment
Moderators IIYAMA Posted January 23, 2014 Moderators Share Posted January 23, 2014 Sorry, but you first need to learn the basic from lua. This isn't worth my time by writing all sample codes, when you can't learn anything from that because you don't know the laughing. Try to make simple things, like wiki mta samples. I will recommend you to leave this project until you are ready for it. and don't tell me you are, because we both know that isn't true. STARTClient Functions Client Events Server Functions Server Events Link to comment
xeon17 Posted January 23, 2014 Author Share Posted January 23, 2014 Ok , ok.... thanks for your ''help'' Link to comment
Moderators IIYAMA Posted January 23, 2014 Moderators Share Posted January 23, 2014 Ok , ok.... thanks for your ''help'' As far as I know, I helped you with a piece of code, I showed you were to start with scripting and I was the only person that was trying to help you. And still with disrespect? Pathetic little kid that you are. Link to comment
xXMADEXx Posted January 24, 2014 Share Posted January 24, 2014 Ok , ok.... thanks for your ''help'' As far as I know, I helped you with a piece of code, I showed you were to start with scripting and I was the only person that was trying to help you. And still with disrespect? Pathetic little kid that you are. No need to get all angry... He just has decided, he wants people to do the work for him. Link to comment
MTA Team 0xCiBeR Posted January 24, 2014 MTA Team Share Posted January 24, 2014 Please do respect one another, everybody was new sometime and maybe wanted the things done for them and actually he did help you so it's a bit harsh to quote "help". @EufraT i do advise you to follow the tutorials on scripting before you try something complex and know that usually no one will do the scripts for you unless you pay them. This is a scripting-help forum where you can get help on some error or that type of problem, the users above helped you out with a code using tables as a base. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now