ViRuZGamiing Posted January 4, 2013 Share Posted January 4, 2013 Hi Community, Here's my script: -- Settings for when a player joins -- XYZ coördinates local joinX = -2462.3999023438 local joinY = 132.69999694824 local joinZ = 35.200000762939 -- Weapon and ammo local joinWeapon = 0 local joinAmmo = 0 -- Message when player joins local joinMessage = "Welcome to Belgium-Reallife." -- Skin that player gets local joinSkin = 0 -- Settings for when a player dies -- XYZ coördinates local spawnX = -2462.3999023438 local spawnY = 132.69999694824 local spawnZ = 35.200000762939 -- Weapon and ammo local spawnWeapon = 0 local spawnAmmo = 0 -- Skin that player gets local spawnSkin = 0 -- Settings for the amounts of money -- Money the killer gets local killerMoney = 0 -- Money removed from player when they die local deadPlayerMoney = 0 -- Money you get when you join local joinMoney = 0 -- Functions -- This function spawns players when they join function spawnOnJoin() spawnPlayer(source, joinX, joinY, joinZ, 0 , joinSkin) fadeCamera(source, true) setCameraTarget(source, source) outputChatBox(joinMessage, source) giveWeapon(source, joinWeapon, joinAmmo) givePlayerMoney(source, joinMoney) end -- This function spawns players after they died function spawnOnDead(ammo, killer, weapon, bodypart) outputChatBox(getPlayerName(source).." died.") takePlayerMoney(source, deadPlayerMoney) if (killer) and (killer ~= source) then givePlayerMoney(killer, killerMoney) end setTimer(spawnPlayer, 3000, 1, source, spawnX, spawnY, spawnZ, 0, spawnSkin) setCameraTarget(source, source) setTimer(giveWeapon, 3000, 1, source, spawnWeapon, spawnAmmo) end -- Event handlers addEventHandler("onPlayerJoin", getRootElement(), spawnOnJoin) addEventHandler("onPlayerWasted", getRootElement(), spawnOnDead) What I want I want to add a If getPlayerteam == "Yakuza" then spawnX, spawnY, spawnZ In this the spawnX, spawnY and spawnZ are different then the Civilian's the Gang members need spawn in Base. Thanks for Helping Link to comment
Castillo Posted January 4, 2013 Share Posted January 4, 2013 Try this: -- Settings for when a player joins -- XYZ coördinates local joinX = -2462.3999023438 local joinY = 132.69999694824 local joinZ = 35.200000762939 -- Weapon and ammo local joinWeapon = 0 local joinAmmo = 0 -- Message when player joins local joinMessage = "Welcome to Belgium-Reallife." -- Skin that player gets local joinSkin = 0 -- Settings for when a player dies -- XYZ coördinates local spawnX = -2462.3999023438 local spawnY = 132.69999694824 local spawnZ = 35.200000762939 -- Weapon and ammo local spawnWeapon = 0 local spawnAmmo = 0 -- Skin that player gets local spawnSkin = 0 -- Settings for the amounts of money -- Money the killer gets local killerMoney = 0 -- Money removed from player when they die local deadPlayerMoney = 0 -- Money you get when you join local joinMoney = 0 -- Functions -- This function spawns players when they join function spawnOnJoin() local x, y, z = joinX, joinY, joinZ if ( getPlayerTeam ( source ) == getTeamFromName ( "Yakuza" ) ) then x, y, z = spawnX, spawnY, spawnZ end spawnPlayer(source, x, y, z, 0 , joinSkin) fadeCamera(source, true) setCameraTarget(source, source) outputChatBox(joinMessage, source) giveWeapon(source, joinWeapon, joinAmmo) givePlayerMoney(source, joinMoney) end -- This function spawns players after they died function spawnOnDead(ammo, killer, weapon, bodypart) outputChatBox(getPlayerName(source).." died.") takePlayerMoney(source, deadPlayerMoney) if (killer) and (killer ~= source) then givePlayerMoney(killer, killerMoney) end local x, y, z = joinX, joinY, joinZ if ( getPlayerTeam ( source ) == getTeamFromName ( "Yakuza" ) ) then x, y, z = spawnX, spawnY, spawnZ end setTimer(spawnPlayer, 3000, 1, source, x, y, z, 0, spawnSkin) setCameraTarget(source, source) setTimer(giveWeapon, 3000, 1, source, spawnWeapon, spawnAmmo) end -- Event handlers addEventHandler("onPlayerJoin", getRootElement(), spawnOnJoin) addEventHandler("onPlayerWasted", getRootElement(), spawnOnDead) Link to comment
ViRuZGamiing Posted January 5, 2013 Author Share Posted January 5, 2013 do I need to edit the "spawnX" or the "x" Link to comment
TAPL Posted January 5, 2013 Share Posted January 5, 2013 do I need to edit the "spawnX" or the "x" Only these what you need to edit You already have them commented. -- Settings for when a player joins -- XYZ coördinates local joinX = -2462.3999023438 local joinY = 132.69999694824 local joinZ = 35.200000762939 -- Weapon and ammo local joinWeapon = 0 local joinAmmo = 0 -- Message when player joins local joinMessage = "Welcome to Belgium-Reallife." -- Skin that player gets local joinSkin = 0 -- Settings for when a player dies -- XYZ coördinates local spawnX = -2462.3999023438 local spawnY = 132.69999694824 local spawnZ = 35.200000762939 -- Weapon and ammo local spawnWeapon = 0 local spawnAmmo = 0 -- Skin that player gets local spawnSkin = 0 -- Settings for the amounts of money -- Money the killer gets local killerMoney = 0 -- Money removed from player when they die local deadPlayerMoney = 0 -- Money you get when you join local joinMoney = 0 Link to comment
ViRuZGamiing Posted January 5, 2013 Author Share Posted January 5, 2013 -- Settings for when a player joins -- XYZ coördinates local joinX = -2462.3999023438 local joinY = 132.69999694824 local joinZ = 35.200000762939 Where is this for team "Yakuza" ? Link to comment
TAPL Posted January 5, 2013 Share Posted January 5, 2013 What? You made the settings and don't know what they for? Are you kidding me? Link to comment
ViRuZGamiing Posted January 5, 2013 Author Share Posted January 5, 2013 I know that are my Civilian spawn coordinates, but where is the joinX, joinY and joinZ for Yakuza Link to comment
TAPL Posted January 5, 2013 Share Posted January 5, 2013 I know that are my Civilian spawn coordinates, but where is the joinX, joinY and joinZ for Yakuza They are spawnX, spawnY, spawnZ Link to comment
ViRuZGamiing Posted January 5, 2013 Author Share Posted January 5, 2013 Now the Civilians spawn on the same position as the Yakuza I want "if team Yakuza" spawn in Yakuza Base Link to comment
Castillo Posted January 5, 2013 Share Posted January 5, 2013 So, joinX, joinY, joinZ should be for "Yakuz" and spawnX, spawnY, spawnZ for normal players? -- Settings for when a player joins -- XYZ coördinates local joinX = -2462.3999023438 local joinY = 132.69999694824 local joinZ = 35.200000762939 -- Weapon and ammo local joinWeapon = 0 local joinAmmo = 0 -- Message when player joins local joinMessage = "Welcome to Belgium-Reallife." -- Skin that player gets local joinSkin = 0 -- Settings for when a player dies -- XYZ coördinates local spawnX = -2462.3999023438 local spawnY = 132.69999694824 local spawnZ = 35.200000762939 -- Weapon and ammo local spawnWeapon = 0 local spawnAmmo = 0 -- Skin that player gets local spawnSkin = 0 -- Settings for the amounts of money -- Money the killer gets local killerMoney = 0 -- Money removed from player when they die local deadPlayerMoney = 0 -- Money you get when you join local joinMoney = 0 -- Functions -- This function spawns players when they join function spawnOnJoin() local x, y, z = spawnX, spawnY, spawnZ if ( getPlayerTeam ( source ) == getTeamFromName ( "Yakuza" ) ) then x, y, z = joinX, joinY, joinZ end spawnPlayer(source, x, y, z, 0 , joinSkin) fadeCamera(source, true) setCameraTarget(source, source) outputChatBox(joinMessage, source) giveWeapon(source, joinWeapon, joinAmmo) givePlayerMoney(source, joinMoney) end -- This function spawns players after they died function spawnOnDead(ammo, killer, weapon, bodypart) outputChatBox(getPlayerName(source).." died.") takePlayerMoney(source, deadPlayerMoney) if (killer) and (killer ~= source) then givePlayerMoney(killer, killerMoney) end local x, y, z = spawnX, spawnY, spawnZ if ( getPlayerTeam ( source ) == getTeamFromName ( "Yakuza" ) ) then x, y, z = joinX, joinY, joinZ end setTimer(spawnPlayer, 3000, 1, source, x, y, z, 0, spawnSkin) setCameraTarget(source, source) setTimer(giveWeapon, 3000, 1, source, spawnWeapon, spawnAmmo) end -- Event handlers addEventHandler("onPlayerJoin", getRootElement(), spawnOnJoin) addEventHandler("onPlayerWasted", getRootElement(), spawnOnDead) Link to comment
TAPL Posted January 5, 2013 Share Posted January 5, 2013 The coördinates are same local joinX = -2462.3999023438 local joinY = 132.69999694824 local joinZ = 35.200000762939 local spawnX = -2462.3999023438 local spawnY = 132.69999694824 local spawnZ = 35.200000762939 You should change them. Link to comment
ViRuZGamiing Posted January 5, 2013 Author Share Posted January 5, 2013 No, lets say: Civilians has a Spawn on join and on death Yakuza have also a Spawn on join and on death The Position of the Spawn on join and on death are different both Link to comment
Castillo Posted January 5, 2013 Share Posted January 5, 2013 When they join, they won't be on a team for sure. Link to comment
ViRuZGamiing Posted January 5, 2013 Author Share Posted January 5, 2013 (edited) I use a Teamsave script https://community.multitheftauto.com/index.php?p= ... ls&id=3396 : Teamsaver Edited January 5, 2013 by Guest Link to comment
Castillo Posted January 5, 2013 Share Posted January 5, 2013 -- Settings for when a player joins -- XYZ coördinates local joinX = -2462.3999023438 local joinY = 132.69999694824 local joinZ = 35.200000762939 -- Weapon and ammo local joinWeapon = 0 local joinAmmo = 0 -- Message when player joins local joinMessage = "Welcome to Belgium-Reallife." -- Skin that player gets local joinSkin = 0 -- Settings for when a player dies -- XYZ coördinates local spawnX = -2462.3999023438 local spawnY = 132.69999694824 local spawnZ = 35.200000762939 -- Weapon and ammo local spawnWeapon = 0 local spawnAmmo = 0 -- Skin that player gets local spawnSkin = 0 -- Settings for the amounts of money -- Money the killer gets local killerMoney = 0 -- Money removed from player when they die local deadPlayerMoney = 0 -- Money you get when you join local joinMoney = 0 local yakuzaPosition = { 0, 0, 5 } -- Functions -- This function spawns players when they join function spawnOnJoin() local x, y, z = joinX, joinY, joinZ if ( getPlayerTeam ( source ) == getTeamFromName ( "Yakuza" ) ) then x, y, z = unpack ( yakuzaPosition ) end spawnPlayer(source, x, y, z, 0 , joinSkin) fadeCamera(source, true) setCameraTarget(source, source) outputChatBox(joinMessage, source) giveWeapon(source, joinWeapon, joinAmmo) givePlayerMoney(source, joinMoney) end -- This function spawns players after they died function spawnOnDead(ammo, killer, weapon, bodypart) outputChatBox(getPlayerName(source).." died.") takePlayerMoney(source, deadPlayerMoney) if (killer) and (killer ~= source) then givePlayerMoney(killer, killerMoney) end local x, y, z = spawnX, spawnY, spawnZ if ( getPlayerTeam ( source ) == getTeamFromName ( "Yakuza" ) ) then x, y, z = unpack ( yakuzaPosition ) end setTimer(spawnPlayer, 3000, 1, source, x, y, z, 0, spawnSkin) setCameraTarget(source, source) setTimer(giveWeapon, 3000, 1, source, spawnWeapon, spawnAmmo) end -- Event handlers addEventHandler("onPlayerJoin", getRootElement(), spawnOnJoin) addEventHandler("onPlayerWasted", getRootElement(), spawnOnDead) Change this line: local yakuzaPosition = { 0, 0, 5 } 0, 0, 5 = coordinates. Link to comment
ViRuZGamiing Posted January 5, 2013 Author Share Posted January 5, 2013 Thank you very much; Castillo and TA-PL 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