Jump to content

R34Lw0rd

Members
  • Posts

    6
  • Joined

  • Last visited

About R34Lw0rd

  • Birthday 06/04/1993

R34Lw0rd's Achievements

Vic

Vic (3/54)

0

Reputation

  1. Ok.With your help, will try to do it: function player_Spawn ( playerValue ) spawnPlayer ( playerValue, 0.0, 0.0, 5.0, 90.0, 0 ) giveWeapon ( playerValue, 31, 200 ) --M4 giveWeapon ( playerValue, 36, 200 ) --Heat Seeker end and? function onJoin () g_Red, g_Green, g_Blue = math.random (50, 255), math.random (50, 255), math.random (50, 255) player_Spawn ( source ) end This part of the code is correct? I can not understand how to use it properly and where to write.. P.S. But what to write in test_client.lua?
  2. And you can not give the already bug-fix code? I just started and therefore nothing in this do not understand.
  3. Hello everyone. I started to write mode using the Wiki, but I have a black screen when you connect. Show where the error, please? test.lua: -- sets colors when player join function onJoin () g_Red, g_Green, g_Blue = math.random (50, 255), math.random (50, 255), math.random (50, 255) end -- checks if player has sent a message function onChat ( message, messageType ) if messageType == 0 then local root = getRootElement() outputChatBox ( getPlayerName ( source ) .. ": #E0D0B0" .. message, getRootElement(), g_Red, g_Green, g_Blue, true ) cancelEvent() end end addEventHandler ( "onPlayerJoin", getRootElement(), onJoin) addEventHandler ( "onPlayerChat", getRootElement(), onChat ) -- Get a table of all the players players = getElementsByType ( "player" ) -- Go through every player -- when a player spawns, function player_Spawn ( posX, posY, posZ, spawnRotation, theTeam, theSkin, theInterior, theDimension ) -- Spawn them at the desired coordinates spawnPlayer ( playerValue, 0.0, 0.0, 5.0, 90.0, 0 ) giveWeapon ( source, 31, 200 ) --M4 giveWeapon ( source, 36, 200 ) --Heat Seeker end addEventHandler ( "onPlayerSpawn", getRootElement(), player_Spawn ) -- we register quitPlayer as a handler for the event function quitPlayer ( quitType ) -- we store the player's name local quittingPlayerName = getPlayerName ( source ) -- and send the message to the server outputChatBox ( quittingPlayerName .. " has left the server (" .. quitType .. ")" ) end addEventHandler ( "onPlayerQuit", getRootElement(), quitPlayer ) function playerDied(totalAmmo, killer, killerWeapon, bodypart) outputChatBox(getPlayerName(source).." died!") end addEventHandler("onPlayerWasted",getRootElement(),playerDied) function respawnVehicle( vehicle ) spawnVehicle ( vehicle, getElementData( vehicle, "posX" ), getElementData( vehicle, "posY" ), getElementData( vehicle, "posZ" ), getElementData( vehicle, "rotX" ), getElementData( vehicle, "rotY" ), getElementData( vehicle, "rotZ" ) ) end test_client.lua: function remotePlayerJoin() outputChatBox("* " .. getPlayerName(source) .. " has joined the server") end addEventHandler("onClientPlayerJoin", getRootElement(), remotePlayerJoin) function onQuitGame( reason ) outputChatBox ( getPlayerName( source ).." has left the server ("..reason..")" ) end addEventHandler( "onClientPlayerQuit", getRootElement(), onQuitGame ) function explosionOnSpawn ( ) -- get the spawned player's position local pX, pY, pZ = getElementPosition ( source ) -- and create an explosion there createExplosion ( pX, pY, pZ, 6 ) fadeCamera( true ) end -- add this function as a handler for any player that spawns addEventHandler ( "onClientPlayerSpawn", getLocalPlayer(), explosionOnSpawn ) function addRednessOnDamage ( ) fadeCamera ( source, false, 1.0, 255, 0, 0 ) -- fade the player's camera to red over a period of 1 second setTimer ( fadeCamera, 500, 1, source, true, 0.5 ) -- don't let it go to opaque red, interrupt it after half a second and fade back to normal end addEventHandler ( "onPlayerDamage", getRootElement(), addRednessOnDamage ) function showClientImage() guiCreateStaticImage( 20, 200, 100, 100, "image\logo.png", false ) end addEventHandler( "onClientResourceStart", getResourceRootElement( getThisResource() ), showClientImage ) P.S. Sorry for my bad english..
×
×
  • Create New...