Jump to content

Character system


Soren

Recommended Posts

  • Replies 110
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Buenisimo gracias, sigo con el script tonces :)

SCRIPT :

--Client side 
addEventHandler("onClientGUIClick", root, 
function() 
    if source == GUIEditor_Button[4] then 
    local r = guiGetText(GUIEditor_Edit[1]) 
    local g = guiGetText(GUIEditor_Edit[2]) 
    local b = guiGetText(GUIEditor_Edit[3]) 
    local userName = guiGetText(GUIEditor_Edit[4]) 
    local guardar = setElementData(localPlayer,"name.Tag",{r,g,b,userName}) 
        if guardar then 
        guiSetVisible(GUIEditor_Window[2],false) 
        local row = guiGridListAddRow ( GUIEditor_Grid[1] ) 
        guiGridListSetItemText(GUIEditor_Grid[1], row, column, (guiGetText(GUIEditor_Edit[4])), false, false) 
        end 
    end 
end 
) 
addEventHandler("onClientGUIClick", root, 
function() 
if source == GUIEditor_Button[1] then 
local nameTag = getElementData(localPlayer,"name.Tag")  
local modeloPed = getElementModel(ped) 
  
triggerServerEvent("guardandoDatos",localPlayer,modeloPed,nameTag) 
end 
end 
  
) 
  

 

 

-- Server Side

 

  
function resourceStart() 
  
executeSQLQuery("CREATE TABLE IF NOT EXISTS personajes(ID STRING,Nickname STRING,Skin NUMBER,x FLOAT,y FLOAT,z FLOAT,r NUMBER,g NUMBER,b NUMBER)") 
  
end 
addEventHandler("onResourceStart",root,resourceStart) 
  
  
function guardandoDatos(modeloPed,nameTag) 
  
    local accountName = getAccountName(getPlayerAccount(source)) 
    local x,y,z = getElementPosition(source) 
    local query = executeSQLQuery("SELECT * FROM personajes WHERE Nickname = '"..nameTag[4].."'") 
    if #query == 0 then 
    executeSQLQuery("INSERT INTO personajes (ID,Nickname,Skin,x,y,z,r,g,b) VALUES ('"..accountName.."','"..nameTag[4].."','"..modeloPed.."','"..x.."','"..y.."','"..z.."','"..nameTag[1].."','"..nameTag[2].."','"..nameTag[3].."')") 
    outputChatBox("Datos guardados a la DB",source) 
    else 
    outputChatBox("Nombre utilizado!",source) 
    end 
end 
addEvent("guardandoDatos",true) 
addEventHandler("guardandosDatos",root,guardandoDatos) 

Edited by Guest
Link to comment

mientras la genete espera a que descargue hare un camara matrix en un avion y contara todo lo que paso.

Y el agua sera toxica asi que no puedes nadar

Edit: Edikosh no subas el script aqui vilmente subelo a mediafire con pass y enviame la pass por pm. no queremos que se lo roben

Link to comment
  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...