Jump to content

Question


xeon17

Recommended Posts

Is this possible i wanna so much crate a spawn system for my Bases :( but i no have idea how

radararea2 = createRadarArea( 110.91990, 1800.89435, 200, 145, 255, 255, 255, 225 ) 
  
function Area_51_Base_Spawn ( player ) 
        local playerTeam = getPlayerTeam ( player )          
         if ( playerTeam ) then    
         local r, g, b = getTeamColor ( playerTeam ) 
         local color = getRadarAreaColor ( radararea2)   
         if ( color = r,g,b ) then 
      setElementPosition ( player, 298.98865, 1815.90613, 3.71094 ) 
   end 
end 
addEventHandler ( "onPlayerSpawn", player, Area_51_Base_Spawn ) 

[

Link to comment

I'm not so good scripter i make to much mistakes. :D :D :D

  
radararea2 = createRadarArea( 110.91990, 1800.89435, 200, 145, 255, 255, 255, 225 ) 
  
function Area_51_Base_Spawn ( source ) 
        local playerTeam = getPlayerTeam ( source )         
         if ( playerTeam ) then   
         local r, g, b = getTeamColor ( playerTeam ) 
         local color = getRadarAreaColor ( radararea2)   
         if ( color = r,g,b ) then 
      setElementPosition ( source, 298.98865, 1815.90613, 3.71094 ) 
   end 
end 
addEventHandler ( "onPlayerSpawn", getRootElement(), Area_51_Base_Spawn ) 

Can this script do , when a player die this script get his team and his team color and the radararea2 color , and if his team and radararea2 have same color then he spawn in the area 51. (radararea2) base :D

Link to comment
radararea2 = createRadarArea(110.91990, 1800.89435, 200, 145, 255, 255, 255, 225) 
  
function Area_51_Base_Spawn() 
    local playerTeam = getPlayerTeam(source)         
    if (playerTeam) then   
        local r, g, b = getTeamColor(playerTeam) 
        local aR, aG, aB = getRadarAreaColor(radararea2)   
        if (r == aR) and (g == aG) and (b == aB) then 
            setElementPosition(source, 298.98865, 1815.90613, 3.71094) 
        end 
    end 
end 
addEventHandler("onPlayerSpawn", getRootElement(), Area_51_Base_Spawn) 

Link to comment

Wow TAPL this is perfect ! thank you so much my Bases system is finished now :) see the script :)

i put your name in authors , your help was verry usefull ;)

----------------------------------------------------- 
-- script  Bases system MTA:SA Gang War 
-- @author EufraT & TAPL 
-- @update 28/1/2014 
----------------------------------------------------- 
  
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)   
Maverick = createVehicle ( 487, 251.64256286621,1920.413574218817,640630722046 ) 
  
 addCommandHandler ( "comprar51", 
function ( player ) 
local money = getPlayerMoney ( player ) 
local playerTeam = getPlayerTeam ( player ) 
local r, g, b = getTeamColor ( playerTeam ) 
local teamMates = getPlayersInTeam ( playerTeam ) 
        if(isElementWithinMarker(player,marker2)) and ( money > 1000000 )  then 
         takePlayerMoney ( player, 1000000 ) 
         setRadarAreaColor ( radararea2, r, g, b, 155 ) 
         outputChatBox ( "#FFF000 [bASE] #FF0000You buyed this base.", player, 0, 0, 0, true ) 
        for _, v in ipairs(teamMates) do 
        outputChatBox ( "#FFF000 [bASE] #FF0000 Sua gang comprou a base #00FF00 Area 51!", v, 0, 0, 0, true ) 
        end 
        else 
        outputChatBox ( "#FFF000 [bASE] #FF0000You don't have money or you are out of checkpoint", player, 0, 0, 0, true ) 
        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 
) 
function Vender ( player ) 
               if(isElementWithinMarker(player,marker2)) then 
               local playerTeam = getPlayerTeam ( player ) 
               if ( playerTeam ) then 
               givePlayerMoney ( player, 1000000 ) 
               setRadarAreaColor ( radararea2, 255, 255, 255, 155 ) 
               outputChatBox ( "#FFF000 [bASE] #FF0000 Sua gang vendeu a base #00ff00 Area 51!", player, 0, 0, 0, true ) 
           end 
        end 
    end 
addCommandHandler ( "vender", Vender ) 
  
function Car_Color ( player ) 
                 if(isElementWithinMarker(player,marker2)) then 
                 local playerTeam = getPlayerTeam ( player ) 
                 if ( playerTeam ) then 
                 local r, g, b = getTeamColor ( playerTeam ) 
                 setVehicleColor( Maverick, r, g, b ) 
              end 
        end 
   end 
addCommandHandler ( "comprar51", Car_Color  ) 
radararea2 = createRadarArea(110.91990, 1800.89435, 200, 145, 255, 255, 255, 225) 
  
function Area_51_Base_Spawn() 
    local playerTeam = getPlayerTeam(source)         
    if (playerTeam) then   
        local r, g, b = getTeamColor(playerTeam) 
        local aR, aG, aB = getRadarAreaColor(radararea2)   
        if (r == aR) and (g == aG) and (b == aB) then 
            setElementPosition(source, 298.98865, 1815.90613, 3.71094) 
        end 
    end 
end 
addEventHandler("onPlayerSpawn", getRootElement(), Area_51_Base_Spawn) 

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...