Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.

Wysłany: 2014-12-05, 15:25


mrmay4141

KOR Gaming Innovator






Wiek: 28
Na forum: 4860 dni
Posty: 86
Nick w MP: Sexyvise

Piwa: 4

Respekt: 50

Ostrzeżeń: 20%
Cze??, mam tu skrypt kt?ry dodaje(niby) d?u?szy nick. Lecz zmienia si? on tylko na chat'cie. Mam serwer RACE wi?c nad pojazdami te? jest nick tylko ?e troszk? wi?kszy i chcia?bym aby podmienia? si? od razu na TAB i nad samochodami.

local supercolor get "*"..getResourceName(getThisResource())..".messageColor" )
local price get "*"..getResourceName(getThisResource())..".nickPrice" )
    
function savePlayerSuperNick (_,account)
    local playerAccount getPlayerAccountsource )
    if ( playerAccount ) and ( not isGuestAccountplayerAccount ) ) then
        local SuperNick getAccountData playerAccount"supernick" )
        if ( SuperNick ) ~= "nil" then
            outputChatBox(supercolor.."[Supernick]: #FFFFFF"..getPlayerName(source).." #FFFFFFname has been changed to his "..supercolor.."supernick #FFFFFF[ "..supercolor..getAccountData(getPlayerAccount(source),"supernick").." #FFFFFF]"root255255255true )
            outputChatBox(supercolor.."[Supernick]: #FFFFFFYour "..supercolor.."supernick #FFFFFFhas been set to "..supercolor..SuperNicksource255255255true )
            setElementData(player,"name",getAccountData(getPlayerAccount(player),"supernick"))
        end
    end
end
addEventHandler("onPlayerLogin",root,savePlayerSuperNick)

function setPlayerSuperNickplayer,command,choice,supernick )
    if ( command == "sp" then
        if ( not isGuestAccountgetPlayerAccount player ) ) ) then
            if ( choice then
                if ( choice == "set" then
                    if ( supernick then
                        if (getPlayerMoney(player) >= tonumber(price)) then
                            setAccountData(getPlayerAccount(player),"supernick",supernick)
                            setElementData(player,"name",getAccountData(getPlayerAccount(player),"supernick"))
                            outputChatBox(supercolor.."[SuperNick]: #FFFFFF"..getPlayerName(player).." #FFFFFFhas bought a "..supercolor.."supernick#FFFFFF for #00FF00$#FFFFFF"..price.." #FFFFFF ( "..supercolor..getAccountData(getPlayerAccount(player),"supernick").."#FFFFFF )",root,255,255,255,true)
                            outputChatBox(supercolor.."[SuperNick]: #FFFFFFYou have bought a  "..supercolor.."supernick #FFFFFFfor #00FF00$#FFFFFF"..price,player,255,255,255,true)
                            takePlayerMoney(player,tonumber(price))
                        else
                            outputChatBox(supercolor.."[SuperNick]: #FFFFFFYou must have atleast #00FF00$#FFFFFF"..price.."#FFFFFF to buy a "..supercolor.."supernick",player,255,255,255,true)
                        end
                    else
                        outputChatBox(supercolor.."[SuperNick]: #FFFFFFYou haven't put a "..supercolor.."supernick #FFFFFF",player,255,255,255,true)
                    end
                elseif ( choice == "remove" then
                    if ( getAccountData(getPlayerAccount(player),"supernick" ) ~= "nil" then
                        outputChatBox(supercolor.."[SuperNick]: #FFFFFF"..getAccountData(getPlayerAccount(player),"supernick" ).."#FFFFFF has removed his "..supercolor.."supernick #FFFFFF( "..supercolor..getPlayerName(player).. " #FFFFFF)",player,255,255,255,true)
                        setAccountData(getPlayerAccount(player),"supernick",nil)
                        setElementData(player,"name",getPlayerName(player))
                        outputChatBox(supercolor.."[SuperNick]: #FFFFFFYour "..supercolor.."supernick #FFFFFFhas been removed",player,255,255,255,true)
                    else
                        outputChatBox(supercolor.."[SuperNick]: #FFFFFFYou do not have a "..supercolor.."supernick #FFFFFFto remove",player,255,255,255,true)
                    end
                else
                    outputChatBox(supercolor.."[SuperNick]: #FFFFFFFormat is: /sp set/remove "..supercolor.."supernick",player,255,255,255,true)
                end
            else
                outputChatBox(supercolor.."[SuperNick]: #FFFFFFFormat is: /sp set/remove "..supercolor.."supernick",player,255,255,255,true)
            end
        else
            outputChatBox(supercolor.."[SuperNick]: #FFFFFFYou must login to set/remove your "..supercolor.."supernick",player,255,255,255,true)
        end
    end
end
addCommandHandler("sp",setPlayerSuperNick)
addEventHandler("onPlayerCommand",getRootElement(),setPlayerSuperNick)

function showPlayerSuperNickOnChat(message,messageType)
    if ( messageType == then

if ( getAccountData getPlayerAccount source ), "supernick" ) ~= "nil" then
            outputChatBox(getAccountData getPlayerAccount source ), "supernick" ).."#FFFFFF: "..message,root,255,255,255,true)
            outputServerLog(getAccountData getPlayerAccount source ), "supernick" )..": "..message)
            cancelEvent()
        end          
    elseif ( messageType == then
        if getPlayerTeam(sourcethen
            if ( getAccountData getPlayerAccount source ), "supernick" ) ~= "nil" then
                for i,team in ipairs(getPlayersInTeam(getPlayerTeam(source))) do
                    local r,g,getTeamColor(getPlayerTeam(source))
                    if ( ) and ( ) and ( then
                        outputChatBox(RGBToHex(r,g,b).."(TEAM) #FFFFFF"..getAccountData(getPlayerAccount(source),"supernick").."#FFFFFF: "..message,team,255,255,255,true)
                        outputServerLog(getAccountData getPlayerAccount source ), "supernick" )..": "..message)
                        cancelEvent()
                    end
                end
            end
        end
    end
end
addEventHandler("onPlayerChat",root,showPlayerSuperNickOnChat)


function RGBToHex(redgreenbluealpha)
    if((red or red 255 or green or green 255 or blue or blue 255) or (alpha and (alpha or alpha 255))) then
        return nil
    end
    if(alphathen
        return string.format("#%.2X%.2X%.2X%.2X"red,green,blue,alpha)
    else
        return string.format("#%.2X%.2X%.2X"red,green,blue)
    end
end


Za pomoc :piwo:

Ostatnio zmieniony przez mrmay4141 2014-12-05, 16:01, w całości zmieniany 1 raz  
Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-12-05, 15:29


MeeShuffle

Programista/Grafik






Wiek: 32
Na forum: 4394 dni
Posty: 2758
Nick w MP: Shuffle

Piwa: 8575

Respekt: 535,3
Respekt: 535,3

setPlayerName zmienia nick gracza, kt?ry jest pokazywany w tab.

Podpis

https://shufflecode.pl
Static Codes and Graphics - Join our discord!
Postaw piwo autorowi tego posta
 

 
Tagi: extra :: nick
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » Extra Nick Ten temat jest zablokowany bez możliwości zmiany postów lub pisania odpowiedzi

Nie możesz pisać nowych tematów
Nie możesz odpowiadać w tematach
Nie możesz zmieniać swoich postów
Nie możesz usuwać swoich postów
Nie możesz głosować w ankietach
Dodaj temat do Ulubionych
Wersja do druku