TheGrimReaper

Members
  • Content count

    25
  • Joined

  • Last visited

Community Reputation

0 Neutral

About TheGrimReaper

  • Rank
    Advanced Member
  1. Join As Guest , Nick Name

    thnx
  2. Join As Guest , Nick Name

    Well on Chat it used to show when the play changed his name, But when i add the cancel event function , its just doesnt show on chat but the player can change his or her name i used this addEventHandler('onPlayerChangeNick', getRootElement(), function() cancelEvent() end )
  3. Join As Guest , Nick Name

    i did but it just stops the nick change dialog from showing nun else
  4. Join As Guest , Nick Name

    @Patrick2562 is there a way that i can stop the guest from changing his nick??
  5. [HELP] Get element from a Table?

    tag = "Radio off" -- Channel Name local change = -1 -- Channel ID -- Turns off Default SA Radio function noRadio() setRadioChannel(0) addEventHandler('onClientPlayerRadioSwitch', getRootElement(), function() cancelEvent() end ) end -- Changing radio Stations, And checks which radio station is on ( it keeps adding to 0 , if channel is 0 then its means Radio is Off ) function change() -- Checks If Radio Was Off And Moves To Channel 1 if change == 0 then change = 1 play1() else change2() end end function change2() -- Checks If Radio Channel was 1 and moves To 2 if change == 1 then change = 2 play2() else change3() end end function change3() -- Checks If Radio Channel was 2 and moves To 3 if change == 2 then change = 3 play3() else change4() end end function change4() -- Checks If Radio Channel was 3 and moves To 0 if change == 3 then change = -1 -- Resets Channel Back to 0 play4() else if change == -1 then play5() end end end function change5() -- Checks If Radio Channel was 3 and moves To 0 if change == -1 then change = 1 -- Resets Channel Back to 0 play() else end end addEvent( "change", true ) addEventHandler( "change", localPlayer, change ) -- Channels For the Radio -- Radio Off function play() tag = "Radio Off" local vehicle = getPedOccupiedVehicle(getLocalPlayer( )) for i, element in ipairs(attachedElements) do destroyElement(element) end tag() end addEvent( "r0", true ) addEventHandler( "r0", localPlayer, play1 ) -- Channel 1 function play1() tag = "HipHop" noRadio() local vehicle = getPedOccupiedVehicle(getLocalPlayer( )) local x,y,z = getElementPosition( vehicle ) local attachedElements = getAttachedElements ( vehicle ) for i, element in ipairs(attachedElements) do destroyElement(element) end sound = playSound3D( "http://us3.internet-radio.com:8313/listen.pls", x, y, z) setSoundMaxDistance( sound,50 ) attachElements ( sound, vehicle) end addEvent( "r1", true ) addEventHandler( "r1", localPlayer, play1 ) -- Channel 2 function play2() tag = "Metal" noRadio() local vehicle = getPedOccupiedVehicle(getLocalPlayer( )) local x,y,z = getElementPosition( vehicle ) local attachedElements = getAttachedElements ( vehicle ) for i, element in ipairs(attachedElements) do destroyElement(element) end sound = playSound3D( "http://188.40.32.140:8061/listen.pls", x, y, z) setSoundMaxDistance( sound,50 ) attachElements ( sound, vehicle) tag() end addEvent( "r2", true ) addEventHandler( "r2", localPlayer, play2 ) -- Channel 3 function play3() tag = "Pop" noRadio() local vehicle = getPedOccupiedVehicle(getLocalPlayer( )) local x,y,z = getElementPosition( vehicle ) local attachedElements = getAttachedElements ( vehicle ) for i, element in ipairs(attachedElements) do destroyElement(element) end sound = playSound3D( "http://uk7.internet-radio.com:8040/listen.pls", x, y, z) setSoundMaxDistance( sound,50 ) attachElements ( sound, vehicle) tag() end addEvent( "r3", true ) addEventHandler( "r3", localPlayer, play3 ) -- Channel 4 function play4() tag = "Dubstep" noRadio() local vehicle = getPedOccupiedVehicle(getLocalPlayer( )) local x,y,z = getElementPosition( vehicle ) local attachedElements = getAttachedElements ( vehicle ) destroyElement(attachedElements) sound = playSound3D( "http://83.142.226.45:25700/listen.pls", x, y, z) setSoundMaxDistance( sound,50 ) attachElements ( sound, vehicle) tag() -- Suppose to Use OnClientRender Here But As Im not Working On the Test Anymore I just Called the function So that I will know Channel Changed. end addEvent( "r4", true ) addEventHandler( "r4", localPlayer, play4 ) -- Channel Name Display function tag() dxDrawText(tag, 492, 10, 907, 61, tocolor(255, 255, 255, 255), 3.00, "default", "left", "top", true, false, false, false, false) end there you go @Pirulax , lets see if u can help me
  6. Join As Guest , Nick Name

    okay thanks man
  7. Join As Guest , Nick Name

    local tag = -1 addEventHandler('onPlayerJoin', root, local tag = tag + 1 function(oldNick, newNick) name = getPlayerName(source) setPlayerName ( source, "Guest_".. tag ) end ) addEventHandler('onPlayerLogin', root, function () setPlayerName ( source, name ) end ) any idea how to make this work , i want to change the player name into guest_*** if he or she hasnt logged in , and when logged in i want the name to be changed back to name they joined from
  8. [HELP] Get element from a Table?

    ty but will its work when the sound element is attached to more than one vehicle?? ill just post my script here. the problem with it is that when i use stop sound it stops the sound from all vehicles , so i need to get the element from the player vehicle itself so i will just get the sound element on his car. and destroy it to stop the first radio and so on. -- client tag = off local change = 0 function noRadio() setRadioChannel(0) addEventHandler('onClientPlayerRadioSwitch', getRootElement(), function() cancelEvent() end ) end function change() if change == 0 then change = 1 play1() else change2() end end function change2() if change == 1 then change = 2 play2() else change3() end end function change3() if change == 2 then change = 3 play3() else change4() end end function change4() if change == 3 then change = 0 play4() else change = 0 change() end end addEvent( "change", true ) addEventHandler( "change", localPlayer, change ) function play() noRadio() outputChatBox("Radio off!!" ) local vehicle = getPedOccupiedVehicle(getLocalPlayer( )) local x,y,z = getElementPosition( vehicle ) local off = getAttachedElements ( vehicle ) destroyElement(off) end addEvent( "play", true ) addEventHandler( "play", localPlayer, play ) function play1() tag = "Hi-Roam HipHop" noRadio() local vehicle = getPedOccupiedVehicle(getLocalPlayer( )) local x,y,z = getElementPosition( vehicle ) local attachedElements = getAttachedElements ( vehicle ) destroyElement(attachedElements) sound = playSound3D( "http://us3.internet-radio.com:8313/listen.pls", x, y, z) setSoundMaxDistance( sound,50 ) attachElements ( sound, vehicle) dxDrawText("Hi-Roam HipHop", 492, 10, 907, 61, tocolor(255, 255, 255, 255), 3.00, "default", "left", "top", true, false, false, false, false) end addEvent( "r1", true ) addEventHandler( "r1", localPlayer, play1 ) function play2() tag = "Hi-Roam Metal" noRadio() local vehicle = getPedOccupiedVehicle(getLocalPlayer( )) local x,y,z = getElementPosition( vehicle ) local attachedElements = getAttachedElements ( vehicle ) destroyElement(attachedElements) sound = playSound3D( "http://188.40.32.140:8061/listen.pls", x, y, z) setSoundMaxDistance( sound,50 ) attachElements ( sound, vehicle) dxDrawText("Hi-Roam Metal", 492, 10, 907, 61, tocolor(255, 255, 255, 255), 3.00, "default", "left", "top", true, false, false, false, false) tag() end addEvent( "r2", true ) addEventHandler( "r2", localPlayer, play2 ) function play3() tag = "Hi-Roam Pop" noRadio() local vehicle = getPedOccupiedVehicle(getLocalPlayer( )) local x,y,z = getElementPosition( vehicle ) local attachedElements = getAttachedElements ( vehicle ) destroyElement(attachedElements) dxDrawText("Hi-Roam Pop", 492, 10, 907, 61, tocolor(255, 255, 255, 255), 3.00, "default", "left", "top", true, false, false, false, false) sound = playSound3D( "http://uk7.internet-radio.com:8040/listen.pls", x, y, z) setSoundMaxDistance( sound,50 ) attachElements ( sound, vehicle) tag() end addEvent( "r3", true ) addEventHandler( "r3", localPlayer, play3 ) function play4() tag = "Hi-Roam Dubstep" noRadio() channel = dxDrawText("Hi-Roam Dubstep", 492, 10, 907, 61, tocolor(255, 255, 255, 255), 3.00, "default", "left", "top", true, false, false, false, false) local vehicle = getPedOccupiedVehicle(getLocalPlayer( )) local x,y,z = getElementPosition( vehicle ) local attachedElements = getAttachedElements ( vehicle ) destroyElement(attachedElements) sound = playSound3D( "http://83.142.226.45:25700/listen.pls", x, y, z) setSoundMaxDistance( sound,50 ) attachElements ( sound, vehicle) tag() end addEvent( "r4", true ) addEventHandler( "r4", localPlayer, play4 ) function tag() dxDrawText("Hi-Roam Pop", 492, 10, 907, 61, tocolor(255, 255, 255, 255), 3.00, "default", "left", "top", true, false, false, false, false) end ignore the function tag() , i didnt clean up this script so it has a lot of useless stuff. so this is how it looks like and from the server side i just call the client side function "change" and dependiing on the number it scrolls through , but the sound doesnt stop at all . and yeah i am not much of a good coder so pls help me out
  9. (HELP)About Name and Team Tag

  10. [HELP] Get element from a Table?

    is it possible to get an element from a table by type , for example when i get attached elements to my car , i attached a sound element to my car. but get attached elements returns all the attached elements in to a table ( as i know) , is there a way to get the sound element from the table ???
  11. [Help]3DRadio test

    nevermind i got it , i had to get attached elements and destroy the sound element Close topic note : there is a copy pasting error in the off function :V ,
  12. [Help]3DRadio test

    function noRadio() setRadioChannel(0) addEventHandler('onClientPlayerRadioSwitch', getRootElement(), function() cancelEvent() end ) end function off() stopSound(sound) noRadio() play1() end addEvent( "off", true ) addEventHandler( "off", localPlayer, play ) function play1() noRadio() stopSound(sound) outputChatBox("Radio 1!!" ) local vehicle = getPedOccupiedVehicle(getLocalPlayer( )) local x,y,z = getElementPosition( vehicle ) sound = playSound3D( "http://us3.internet-radio.com:8313/listen.pls", x, y, z) setSoundMaxDistance( sound,50 ) attachElements ( sound, vehicle) end addEvent( "r1", true ) addEventHandler( "r1", localPlayer, play1 ) function play2() noRadio() stopSound(sound) outputChatBox("Radio 2" ) local vehicle = getPedOccupiedVehicle(getLocalPlayer( )) local x,y,z = getElementPosition( vehicle ) sound = playSound3D( "http://188.40.32.140:8061/listen.pls", x, y, z) setSoundMaxDistance( sound,50 ) attachElements ( sound, vehicle) end addEvent( "r2", true ) addEventHandler( "r2", localPlayer, play2 ) function play3() noRadio() stopSound(sound) outputChatBox("Radio 3") local vehicle = getPedOccupiedVehicle(getLocalPlayer( )) local x,y,z = getElementPosition( vehicle ) sound = playSound3D( "http://uk7.internet-radio.com:8040/listen.pls", x, y, z) setSoundMaxDistance( sound,50 ) attachElements ( sound, vehicle) end addEvent( "r3", true ) addEventHandler( "r3", localPlayer, play3 ) function play4() noRadio() stopSound(sound) outputChatBox("Radio 4!!" ) local vehicle = getPedOccupiedVehicle(getLocalPlayer( )) local x,y,z = getElementPosition( vehicle ) sound = playSound3D( "http://83.142.226.45:25700/listen.pls", x, y, z) setSoundMaxDistance( sound,50 ) attachElements ( sound, vehicle) end addEvent( "r4", true ) addEventHandler( "r4", localPlayer, play4 ) how can i stop sound only for me without stopping others sound?? like when i switch radio station it stops "sound" which stops everyones
  13. [HELP] Clan Adding Script

    thank you a lot
  14. [HELP] Clan Adding Script

    function create() FO = createTeam ( "Forever", 255, 0, 0 ) AV = createTeam ( "Avalanche", 255, 255, 255 ) GH = createTeam ( "Ghost", 255, 123, 0 ) end function addplayer(player, cmd, target, clan) local recipient = getPlayerFromName(target) local accName = getAccountName ( getPlayerAccount ( recipient ) ) -- get his account name if isObjectInACLGroup ("user."..accName, aclGetGroup ( clan ) ) then outputChatBox("* " .. recipientName .. " is already in your clan" , player, 255, 0, 0, true) else if recipient then local r, g, b local recipientName = getPlayerName(recipient) local playerName = getPlayerName(player) outputChatBox("*" .. recipientName .. " #FFFFFF has been added #FF0000" .. clan .. "#FFFFFF clan" , player, 255, 0, 0, true) outputChatBox("*" .. playerName .. " #FFFFFF added you to #FF0000" .. clan .. "#FFFFFF Clan", recipient, 255, 0, 0, true) setPlayerTeam ( recipient, clan ) r, g, b = getTeamColor (clan) setPlayerNametagColor ( recipient, r, g, b ) aclGroupAddObject (aclGetGroup(clan), "user."..accName) else outputChatBox("Sorry, we got 0 matches to the name" .. recipientName, player, 255, 0, 0) end end end function kickplayer(player, cmd, target, clan) local recipient = getPlayerFromName(target) local accName = getAccountName ( getPlayerAccount ( recipient ) ) -- get his account name local r,g,b if isObjectInACLGroup ("user."..accName, aclGetGroup ( clan ) ) then setPlayerTeam ( recipient, nil ) setPlayerNametagColor ( recipient, 225, 225, 225 ) aclGroupRemoveObject (aclGetGroup(clan), "user."..accName) else outputChatBox("The Player is Not in" .. clan .. "Clan" .. clan, player, 255, 0, 0) end end addCommandHandler("add", addplayer) addCommandHandler("ckick", kickplayer) addEventHandler ( "onResourceStart", getRootElement(), create ) This is a Clan system that i am working on, and when i run the script i get 2 errors , one is from the "setPlayerTeam" and the other one is from "GetTeamcolor" First One is : @ 'setPlayerTeam' [ Expected team at argument 2, got string 'AV' ] Second one is : @ 'getTeamColor' [Expected team at argument, got string 'AV'] Pls help me out , ik what this means but havent found a way to fix this And since This forum has helped me a lot , i am asking here , And also i would like to know a way to make this script to be able to Run for people In Acl group FOL , AVL and GHL ( which are clan leaders ) Thanks in Advance
  15. [help] Check If player is in Clan and Add back on login

    ty