Jump to content

xeon17

Members
  • Posts

    1,903
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by xeon17

  1. xeon17

    help ..

    try this , i'm not sure what are you trying to do. function ranks ( thePlayer ) local account = getPlayerAccount ( thePlayer ) if ( account ) then local accountName = getAccountName ( account ) if not ( isObjectInACLGroup ( "user.".. accountName, aclGetGroup ( "|LTN" ) ) ) then --Grupo Admin-- local clan = tonumber ( clan ) setElementData ( thePlayer, "clan",":ranks/rangos/"..getElementData(thePlayer(),"level")..".png" ) triggerClientEvent("Rango",theplayer, clan) end end
  2. xeon17

    help ..

    What not work ? anything in debug ? ( /debugscript 3 )
  3. xeon17

    Pomoc oko scripte

    Ima li koga zivog u ovom forumu ._. inace , problem rijesen davno ._..
  4. xeon17

    [HELP]

    This is perfect ! thanks so much TAPL
  5. xeon17

    [HELP]

    WORKING ! FUCK YEAH ! :D but i got a problem with client script now , when i login i choose skin , but buttons are here before the login ._. CLIENT: local x, y = guiGetScreenSize() SkinMusic = "data/music/SkinSelectMusic.mp3" SkinAnims = {"dnce_M_b","DAN_Left_A","DAN_Down_A","DAN_Loop_A"} StartSkin = 0 NewSkin = false --client addEvent("TriggerClient",true) function SelectSkin () setElementInterior ( getLocalPlayer(), 0, 0,0,0 ) setCameraMatrix( 2745.8266601563,-2231.1694335938,62.25520324707, 3999.9999499991,-2607.4000244141,16.1) skin = createPed ( StartSkin, 2749.7502441406,-2232.7170410156,61.727611541748,60 ) setPedAnimation( skin, "DANCING", SkinAnims[math.random(1,4)]) fadeCamera( true, 10) setTime(0,0) SkinSelectMusic = playSound(SkinMusic,true) bindKey("arrow_r","down",NextSkin) bindKey("arrow_l","down",LastSkin) bindKey(".","down",SpawnPlayer) addEventHandler("onClientRender",getRootElement(),AnnounceSkinJob) showCursor(true) showChat(false) showPlayerHudComponent ( "radar", false ) end addEventHandler("TriggerClient",root,SelectSkin) function SpawnPlayer() local r,g,b = math.random(0,255),math.random(0,255),math.random(0,255) triggerServerEvent ( "onClientWantsToSpawn", getLocalPlayer(), getLocalPlayer(),StartSkin,r,g,b ) unbindKey("arrow_r","down",NextSkin) unbindKey("arrow_l","down",LastSkin) unbindKey("lshift","down",SpawnPlayer) setTime(12,0) stopSound(SkinSelectMusic) removeEventHandler("onClientRender",getRootElement(),AnnounceSkinJob) showCursor(false) showChat(true) showPlayerHudComponent ( "radar", true ) guiSetVisible(lnextskin,false) guiSetVisible(rnextskin,false) guiSetVisible(spawnskin,false) setElementData(getLocalPlayer(),"red",r) setElementData(getLocalPlayer(),"green",g) setElementData(getLocalPlayer(),"blue",b) end function NextSkin() if StartSkin == 312 then StartSkin = -1 elseif StartSkin == 2 then StartSkin = 8 end StartSkin = StartSkin + 1 setElementModel(skin,StartSkin) setPedAnimation( skin, "DANCING", SkinAnims[math.random(1,4)]) SkinJobTextColor() end function LastSkin() if StartSkin == 0 then StartSkin = 313 elseif StartSkin == 9 then StartSkin = 3 end StartSkin = StartSkin - 1 setElementModel(skin,StartSkin) setPedAnimation( skin, "DANCING", SkinAnims[math.random(1,4)]) SkinJobTextColor() end lnextskin = guiCreateButton(x-x/1.30,y/1.22,x/5,y/20,"<<<",false) guiSetProperty(lnextskin,"PushedTextColour","FFFFFF00") guiSetFont(lnextskin,"sa-header") rnextskin = guiCreateButton(x-x/2.90,y/1.22,x/5,y/20,">>>",false) guiSetProperty(rnextskin,"PushedTextColour","FFFFFF00") guiSetFont(rnextskin,"sa-header") spawnskin = guiCreateButton(x-x/1.80,y/1.22,x/5,y/20,"Play",false) guiSetProperty(spawnskin,"PushedTextColour","FFFFFF00") guiSetFont(spawnskin,"sa-header") addEventHandler( "onClientGUIClick", getRootElement(), function() if source == lnextskin then LastSkin() elseif source == rnextskin then NextSkin() elseif source == spawnskin then SpawnPlayer() end end) ------PEDS function FreezeBots() local Bots = getElementsByType("ped") for k,v in ipairs(Bots) do setElementFrozen(v,true) end end function loadMansion () outputChatBox("[bem-Vindo Ao Server]", getRootElement(), 255, 0, 0,true ) end addEventHandler("onClientResourceStart", getResourceRootElement(), loadMansion) SERVER: local spawnLocations = { {2171.90625, 1392.59765625, 10.8203125}, {2265.3674316406, 2398.3068847656, 10.8203125}, {2361.689453125, 2070.2077636719, 10.671875}, {2087.9260253906, 1448.8768310547, 10.8203125}, {2000.55, 1526.25, 14.6171875}, {1607.35, 1816.54, 10.82} } StartMoney = 2500 CashForKill = 2500 PayNSprayCost = 100 playerSkin = {} Garages = {0,1,2,3,4,5,6,7,8,9,10, 11,12,13,14,15,16,17,18,19,20, 21,22,23,24,25,26,27,28,29,30, 31,32,33,34,35,36,37,38,39,40, 41,42,43,44,45,46,47,48,49,50, 51,52,53,54,55,56,57,58,59,60} function SpawnPlayer(thePlayer,skin,r,g,b) spawnPlayer ( thePlayer, 2265.3674316406, 2398.3068847656, 10.8203125, 90.0, skin ) setCameraTarget (source, source) createBlipAttachedTo(source,0,2,r,g,b) setPlayerMoney(thePlayer,StartMoney) playerSkin[thePlayer] = {skin,r,g,b} setElementData(thePlayer,"Score",0) setPlayerNametagShowing ( thePlayer, false) end addEvent( "onClientWantsToSpawn", true ) addEventHandler( "onClientWantsToSpawn", getRootElement(), SpawnPlayer ) addEventHandler ( "onPlayerQuit", getRootElement(), function() local attachedElements = getAttachedElements ( source ) if ( attachedElements ) then for k,v in ipairs ( attachedElements ) do if ( getElementType ( v ) == "blip" ) then destroyElement(v) else end end end end) function PlayerDied(ammo,killer) if killer and getElementType ( killer ) == "player" then setPlayerMoney(killer,getPlayerMoney(killer)+CashForKill) local Score = getElementData(killer,"Score") setElementData(killer,"Score",Score+1) end setTimer(PlayerRespawn,1000,1,source) end addEventHandler("onPlayerWasted",getRootElement(),PlayerDied) function PlayerRespawn(diedPlayer) if not diedPlayer then else toggleAllControls(diedPlayer,true) setPlayerMoney(diedPlayer,StartMoney) local chosenSpawnLocation = math.random(1,#spawnLocations) spawnPlayer(diedPlayer,spawnLocations[chosenSpawnLocation][1],spawnLocations[chosenSpawnLocation][2],spawnLocations[chosenSpawnLocation][3],90,playerSkin[diedPlayer][1]) setCameraTarget (diedPlayer, diedPlayer) end end function FixPlayerVehicle(hitElement,number) local money = getPlayerMoney(hitElement) if money < PayNSprayCost then outputChatBox("*PM: You don't have enought cash.",hitElement,170,0,0,true) else if getPedOccupiedVehicle(hitElement) then local vehicle = getPedOccupiedVehicle(hitElement) fixVehicle(vehicle) playSoundFrontEnd(hitElement,16) toggleAllControls(hitElement,false) setPlayerMoney(hitElement,money-PayNSprayCost) local vehicle = getPedOccupiedVehicle(hitElement) setElementFrozen(vehicle,true) setTimer(function() toggleAllControls(hitElement,true) setCameraTarget (hitElement, hitElement) setElementFrozen(vehicle,false) end,2500,1) if number == 1 then setCameraMatrix(hitElement,1032.7685546875,-1039.337890625,45.220012664795,1030.095703125,-1027.6357421875,40.220008850098) elseif number == 2 then setCameraMatrix(hitElement,489.150390625,-1728.8310546875,31.169326782227,488.6884765625,-1734.04296875,21.179261207581) elseif number == 3 then setCameraMatrix(hitElement,2076.5859375,-1831.4208984375,18.546875,2072.626953125,-1831.361328125,18.546875) else end end end end addEvent( "onBoughtWeapon", true ) addEventHandler( "onBoughtWeapon", getRootElement(), function(thePlayer,id,cash) setPlayerMoney(thePlayer,getPlayerMoney(thePlayer)-cash) if id == 500 then setPedArmor ( thePlayer, 100 ) else giveWeapon ( thePlayer, id, 120 ) end end) addEvent( "onBoughtBurger", true ) addEventHandler( "onBoughtBurger", getRootElement(), function(thePlayer,cash) setPlayerMoney(thePlayer,getPlayerMoney(thePlayer)-cash) setElementHealth(thePlayer,getElementHealth(thePlayer)+cash) if getElementHealth > 100 then setElementHealth(thePlayer,100) end end) --server addEventHandler ( "onPlayerLogin",root, function() triggerClientEvent(source,"TriggerClient",root) end ) PHOTO > http://prikachi.com/images/253/7337253k.png
  6. xeon17

    [HELP]

    Fix it then , :DDDD joke , i'll try it by myself.
  7. xeon17

    [HELP]

    Bug fixed but when player spawn he again spawn with CJ skin.. not with the skin choosen in skin-selector
  8. xeon17

    [HELP]

    I can't see where
  9. xeon17

    [HELP]

    I got a bug [2014-05-19 12:06:17] SCRIPT ERROR: selector-skin\s.lua:67: ')' expected (to close '(' at line 66) near 'setCameraTarget' [2014-05-19 12:06:17] ERROR: Loading script failed: selector-skin\s.lua:67: ')' expected (to close '(' at line 66) near 'setCameraTarget' Code: local spawnLocations = { {2171.90625, 1392.59765625, 10.8203125}, {2265.3674316406, 2398.3068847656, 10.8203125}, {2361.689453125, 2070.2077636719, 10.671875}, {2087.9260253906, 1448.8768310547, 10.8203125}, {2000.55, 1526.25, 14.6171875}, {1607.35, 1816.54, 10.82} } StartMoney = 2500 CashForKill = 2500 PayNSprayCost = 100 playerSkin = {} Garages = {0,1,2,3,4,5,6,7,8,9,10, 11,12,13,14,15,16,17,18,19,20, 21,22,23,24,25,26,27,28,29,30, 31,32,33,34,35,36,37,38,39,40, 41,42,43,44,45,46,47,48,49,50, 51,52,53,54,55,56,57,58,59,60} function SpawnPlayer(thePlayer,skin,r,g,b) spawnPlayer ( thePlayer, 2265.3674316406, 2398.3068847656, 10.8203125, 90.0, skin ) setCameraTarget (source, source) createBlipAttachedTo(source,0,2,r,g,b) setPlayerMoney(thePlayer,StartMoney) playerSkin[thePlayer] = {skin,r,g,b} setElementData(thePlayer,"Score",0) setPlayerNametagShowing ( thePlayer, false) end addEvent( "onClientWantsToSpawn", true ) addEventHandler( "onClientWantsToSpawn", getRootElement(), SpawnPlayer ) addEventHandler ( "onPlayerQuit", getRootElement(), function() local attachedElements = getAttachedElements ( source ) if ( attachedElements ) then for k,v in ipairs ( attachedElements ) do if ( getElementType ( v ) == "blip" ) then destroyElement(v) else end end end end) function PlayerDied(ammo,killer) if killer and getElementType ( killer ) == "player" then setPlayerMoney(killer,getPlayerMoney(killer)+CashForKill) local Score = getElementData(killer,"Score") setElementData(killer,"Score",Score+1) end setTimer(PlayerRespawn,1000,1,source) end addEventHandler("onPlayerWasted",getRootElement(),PlayerDied) function PlayerRespawn(diedPlayer) if not diedPlayer then else toggleAllControls(diedPlayer,true) setPlayerMoney(diedPlayer,StartMoney) local chosenSpawnLocation = math.random(1,#spawnLocations) spawnPlayer(diedPlayer,spawnLocations[chosenSpawnLocation][1],spawnLocations[chosenSpawnLocation][2],spawnLocations[chosenSpawnLocation][3],playerSkin[diedPlayer][1] setCameraTarget (diedPlayer, diedPlayer) end end function FixPlayerVehicle(hitElement,number) local money = getPlayerMoney(hitElement) if money < PayNSprayCost then outputChatBox("*PM: You don't have enought cash.",hitElement,170,0,0,true) else if getPedOccupiedVehicle(hitElement) then local vehicle = getPedOccupiedVehicle(hitElement) fixVehicle(vehicle) playSoundFrontEnd(hitElement,16) toggleAllControls(hitElement,false) setPlayerMoney(hitElement,money-PayNSprayCost) local vehicle = getPedOccupiedVehicle(hitElement) setElementFrozen(vehicle,true) setTimer(function() toggleAllControls(hitElement,true) setCameraTarget (hitElement, hitElement) setElementFrozen(vehicle,false) end,2500,1) if number == 1 then setCameraMatrix(hitElement,1032.7685546875,-1039.337890625,45.220012664795,1030.095703125,-1027.6357421875,40.220008850098) elseif number == 2 then setCameraMatrix(hitElement,489.150390625,-1728.8310546875,31.169326782227,488.6884765625,-1734.04296875,21.179261207581) elseif number == 3 then setCameraMatrix(hitElement,2076.5859375,-1831.4208984375,18.546875,2072.626953125,-1831.361328125,18.546875) else end end end end addEvent( "onBoughtWeapon", true ) addEventHandler( "onBoughtWeapon", getRootElement(), function(thePlayer,id,cash) setPlayerMoney(thePlayer,getPlayerMoney(thePlayer)-cash) if id == 500 then setPedArmor ( thePlayer, 100 ) else giveWeapon ( thePlayer, id, 120 ) end end) addEvent( "onBoughtBurger", true ) addEventHandler( "onBoughtBurger", getRootElement(), function(thePlayer,cash) setPlayerMoney(thePlayer,getPlayerMoney(thePlayer)-cash) setElementHealth(thePlayer,getElementHealth(thePlayer)+cash) if getElementHealth > 100 then setElementHealth(thePlayer,100) end end) --server addEventHandler ( "onPlayerLogin",root, function() triggerClientEvent(source,"TriggerClient",root) end )
  10. xeon17

    [HELP]

    I already seen this, but i wrote it wrong as it looks. local chosenSpawnLocation = math.random(1,#spawnLocations) spawnPlayer(diedPlayer,spawnLocations[chosenSpawnLocation][1],spawnLocations[chosenSpawnLocation][2],spawnLocations[chosenSpawnLocation][3],playerSkin[diedPlayer][1]) i'm going try your code , i'll answer after 1 minute.
  11. xeon17

    [HELP]

    I tried to add skin ''58'' in table PlayerSkin , and choosen the skin 58 in selector skin , still . when i spawn i have skin CJ ( ID:CJ) witch i no choosen in the skin-selector.
  12. xeon17

    Blips no work

    Without bugs & problem , everything good thanks TAPL & Wassim , problem solved. TAPL please take a eye on this ._. > viewtopic.php?f=91&t=75303&start=30
  13. xeon17

    [HELP]

    THERE IS A BUG in script [2014-05-19 11:36:30] WARNING: selector-skin\s.lua:42: Bad argument @ 'getElementType' [Expected element at argument 1]
  14. xeon17

    Blips no work

    fix them then , heuheuheu , joke. i'll try the script soon and answer here about the results.
  15. xeon17

    Blips no work

    When player change gang he got other nametag color and his blip color should be like that gang color. extample i'm CRIME (red color) and i'm leave crime and join LEI (blue color) my blip color will be still red.
  16. xeon17

    [HELP]

    It worked without problems before , but i edited the spawn part of the script and changed spawn locations and now player spawn with only SKIN 0 , take a eye on frist code i posted.. it spawned player with skin he choosen Hope someone can help me.. Thanks.
  17. xeon17

    Blips no work

    Thanks , but can you add that player blips update every 5 seconds , because if the player change gang he have wrong blip color ._. Thanks TAPL
  18. xeon17

    Scores help

    I did what you said and fixed the problem , when the script restart scores no reset.. and i fixed the bug with emty kills/deaths/ratio when a new player enter serer.. thanks for your help the script work perfect now.
  19. xeon17

    Blips no work

    I'll post the full code , because i edited the script a little. I tried to make that players without gang have a blip too. but no work , of couse local pBlips = {} function onSpawn ( p ) if ( not source or not isElement ( source ) and p and isElement ( p ) ) then source = p end takeAllWeapons ( source ) setPlayerMoney ( source, 0 ) giveWeapon ( source, 24, 100 ) setPedStat ( source, 73, 1000 ) setPedStat ( source, 75, 1000 ) setPedStat ( source, 71, 1000 ) setPedStat ( source, 75, 1000 ) setPedStat ( source, 77, 1000 ) setPedStat ( source, 78, 1000 ) giveWeapon ( source, 26, 100 ) giveWeapon ( source, 32, 100 ) giveWeapon ( source, 31, 150 ) giveWeapon ( source, 46, 200 ) givePlayerMoney ( source, 5000 ) local playerTeam = getPlayerTeam(source) if (playerTeam) and not pBlips[source] then local r, g, b = getTeamColor(playerTeam) local myBlip = createBlipAttachedTo ( source, 0 , 10 , r,g,b ) pBlips[source] = myBlip elseif pBlips[source] then destroyPlayerBlip(source) end end function destroyPlayerBlip(pElement) local theElement = source or pElement if pBlips[theElement] then destroyElement(pBlips[theElement]) pBlips[theElement] = nil end end addEventHandler("onPlayerSpawn", getRootElement(), onSpawn) addEventHandler("onPlayerQuit", getRootElement(), destroyPlayerBlip) addEventHandler("onPlayerWasted", getRootElement(), destroyPlayerBlip) addEventHandler ( 'onResourceStart', resourceRoot, function ( ) for _, p in pairs ( getElementsByType ( "player" ) ) do onSpawn ( p ) end end ) function Blip ( ) local playerTeam = getPlayerTeam(source) if ( not playerTeam) then local MeuBlip = createBlipAttachedTo ( source, 0 , 2 , 255,255,255 ) end end addEventHandler ( "onPlayerSpawn", getRootElement(), onSpawn ) ERROR with code of xMADEx : [2014-05-19 08:06:16] WARNING: [ST]Spawn\Spawn.lua:21: Bad 'player' pointer @ 'getPlayerTeam'(1)
  20. xeon17

    Scores help

    my computer have problems to start. i'll try it and answer in the topic. i'm now on my phone
  21. xeon17

    Scores help

    take a eye on post 3 in this topic, the code i posted.
  22. xeon17

    Scores help

    and there is +1 problem, when a new player login, his kills/deaths/ratio on scoreboard are emty
  23. xeon17

    Scores help

    i alerdy tried it , but the script stoped working. i think i did something wrong.
  24. xeon17

    Blips no work

    why the script no work, can someone help me
×
×
  • Create New...