Jump to content

Character system


Soren

Recommended Posts

  • Replies 110
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

GUIEditor_Window = {} 
GUIEditor_Button = {} 
GUIEditor_Label = {} 
GUIEditor_Edit = {} 
GUIEditor_Grid = {} 
rotation = 0 
  
GUIEditor_Window[1] = guiCreateWindow(0.75,0,0.25,0.9967,"GUI IDs",true) 
guiWindowSetMovable(GUIEditor_Window[1],false) 
guiWindowSetSizable(GUIEditor_Window[1],false) 
GUIEditor_Label[1] = guiCreateLabel(25,28,113,21,"Escoge el ID ",false,GUIEditor_Window[1]) 
guiSetFont(GUIEditor_Label[1],"default-bold-small") 
GUIEditor_Grid[1] = guiCreateGridList(9,63,182,463,false,GUIEditor_Window[1]) 
guiGridListSetSelectionMode(GUIEditor_Grid[1],2) 
  
column = guiGridListAddColumn(GUIEditor_Grid[1],"ID",0.2) 
GUIEditor_Button[1] = guiCreateButton(10,532,181,37,"Empezar a Jugar",false,GUIEditor_Window[1]) 
  
GUIEditor_Window[2] = guiCreateWindow(0,0,0.245,0.4567,"GUI Seleccion",true) 
guiWindowSetMovable(GUIEditor_Window[2],false) 
guiWindowSetSizable(GUIEditor_Window[2],false) 
GUIEditor_Button[2] = guiCreateButton(23,36,57,31,"<",false,GUIEditor_Window[2]) 
GUIEditor_Button[3] = guiCreateButton(80,36,57,31,">",false,GUIEditor_Window[2]) 
GUIEditor_Label[2] = guiCreateLabel(27,78,100,22,"NameTag Color",false,GUIEditor_Window[2]) 
GUIEditor_Edit[1] = guiCreateEdit(65,98,61,23,"",false,GUIEditor_Window[2]) 
guiEditSetMaxLength(GUIEditor_Edit[1],3) 
GUIEditor_Label[3] = guiCreateLabel(52,101,9,15,"R",false,GUIEditor_Window[2]) 
guiLabelSetColor(GUIEditor_Label[3],255,0,0) 
GUIEditor_Edit[2] = guiCreateEdit(65,123,61,23,"",false,GUIEditor_Window[2]) 
guiEditSetMaxLength(GUIEditor_Edit[2],3) 
GUIEditor_Label[4] = guiCreateLabel(52,127,9,15,"G",false,GUIEditor_Window[2]) 
guiLabelSetColor(GUIEditor_Label[4],0,255,0) 
GUIEditor_Edit[3] = guiCreateEdit(65,147,61,23,"",false,GUIEditor_Window[2]) 
GUIEditor_Label[5] = guiCreateLabel(52,151,9,15,"B",false,GUIEditor_Window[2]) 
guiLabelSetColor(GUIEditor_Label[5],0,0,255) 
GUIEditor_Label[6] = guiCreateLabel(9,189,83,17,"Nombre del ID",false,GUIEditor_Window[2]) 
GUIEditor_Edit[4] = guiCreateEdit(96,186,91,23,"",false,GUIEditor_Window[2]) 
GUIEditor_Button[4] = guiCreateButton(9,230,169,28,"Crear Personaje/ID",false,GUIEditor_Window[2]) 
  
guiSetVisible(GUIEditor_Window[1],false) 
guiSetVisible(GUIEditor_Window[2],false) 
showCursor(false) 
  
addEvent("onVisible",true) 
addEventHandler("onVisible", getLocalPlayer(),  
function() 
guiSetVisible(GUIEditor_Window[1],true) 
guiSetVisible(GUIEditor_Window[2],true) 
showPlayerHudComponent ("radar",false) 
showCursor(true) 
guiSetInputMode("no_binds_when_editing") 
triggerServerEvent("onCameraMatrix", getLocalPlayer()) 
ped = createPed( 0, -1586.671875, 1351.53125, 8.2823114395142 ) 
end 
) 
  
addEventHandler("onClientGUIClick", root,  
function() 
if source == GUIEditor_Button[1] then 
guiSetVisible(GUIEditor_Window[1],false) 
guiSetVisible(GUIEditor_Window[2],false) 
showCursor(false) 
setElementPosition( localPlayer, 2580.7265625, 2328.77734375, 17.822208404541) 
destroyElement(ped) 
setCameraTarget( localPlayer ) 
setPlayerNametagColor ( localPlayer, tonumber ( guiGetText ( GUIEditor_Edit[1] ) ), tonumber ( guiGetText ( GUIEditor_Edit[2] ) ), tonumber ( guiGetText ( GUIEditor_Edit[3] ) ) ) 
showPlayerHudComponent ("radar",true) 
end 
end 
) 
  
function rotateTempPed ( ) 
    if isElement ( ped ) then 
        rotation = rotation + 1 
        if ( rotation > 359 ) then 
            rotation = 0 
        end 
  
        setPedRotation ( ped, rotation ) 
    end 
end 
addEventHandler("onClientRender", root, rotateTempPed) 
  
  
  
numero = 0 
  
function on_pushButton_2_clicked(button,state) 
    if (button == "left" and state == "up") then 
    if(numero == 1) then return end 
    numero = numero - 1 
    setElementModel(ped,numero) 
    
    end 
end 
addEventHandler("onClientGUIClick", GUIEditor_Button[2], on_pushButton_2_clicked) 
  
function on_pushButton_3_clicked(button,state) 
    if (button == "left" and state == "up") then 
    if (numero == 200) then return end 
    numero = numero + 1 
    setElementModel(ped,numero) 
    end 
end 
addEventHandler("onClientGUIClick", GUIEditor_Button[3], on_pushButton_3_clicked) 
  
addEventHandler("onClientGUIClick", root,  
function() 
if source == GUIEditor_Button[4] 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 
) 
  
addEventHandler("onClientGUIClick", root,  
function() 
local getModel = getElementModel(ped) 
triggerServerEvent("guardandoDatos",localPlayer) 
end 
end 
) 

sv-side

addEventHandler("onPlayerLogin", getRootElement(),  
function() 
triggerClientEvent(source,"onVisible",source) 
end 
) 
  
addEvent("onCameraMatrix", true) 
addEventHandler("onCameraMatrix", getRootElement(),  
function() 
setCameraMatrix( source, -1570.66796875, 1358.087890625, 11.218300819397, -1586.671875, 1351.53125, 8.2823114395142 ) 
end 
) 
  
function resourceStart() 
triggerClientEvent("onClientGetModel", ped) 
  
executeSQLCreateTable ( "skins", "TheID TEXT, theSkinID NUMBER" ) ---esto es en lo q nos emos complicado 
  
end 
addEventHandler("onResourceStart",root,resourceStart) 

mtascreen20120430012858.png

mtascreen20120430012902.png

Nos falta el sistema de SQL y lo tenemos listo :)

Link to comment

Gracias :) pero nos falta el sistema de guardado SQL y yo no entiendo ni pito de SQL :/ osea entiendo lo que me explico ayer edikosh entiendo la estructura pero no se de donde sacamos los valores y como agregarlos a la tabla :/

EDIT: ZeuZ mi Pt modem xD tiene proteccion contra descargas y no puedo entrar ni a mediafire ni a rapidshare ni a ninguno de esos :/

Link to comment

ElMota eres un genio! Son unos genios todos los que me ayudaron! mil gracias a todos son todos geniales!

Cuando acabemos eso, solo tendre que hacer las misiones y listo el server estara open. La version 2.0 contendra una nueva isla que pagaras alrededor de 5000 para ir. Sera de lujo pero sera mas dificil de matar zombies.

Mil gracias Mota y Edikosh! solo los toques finales de SQL y listo!

Ymb hay que hacer que salve la posicion de cada personaje. y lo que tiene ese personaje y un limite de 3 personajes por player.

O falto tmb el boton que diga create Character

Link to comment

aa por si acaso soren se me avia olvidado decirte togglie el radar asi al precionar el boton empezar a jugar vuelve a aparecer *-*

ademas edikosh seria bueno que no apareciera el Window[2] al loggearse nuevamente asi al precionar el nuevo boton que puse :

GUIEditor_Window = {} 
GUIEditor_Button = {} 
GUIEditor_Label = {} 
GUIEditor_Edit = {} 
GUIEditor_Grid = {} 
rotation = 0 
  
GUIEditor_Window[1] = guiCreateWindow(0.75,0,0.25,0.9967,"GUI IDs",true) 
guiWindowSetMovable(GUIEditor_Window[1],false) 
guiWindowSetSizable(GUIEditor_Window[1],false) 
GUIEditor_Button[1] = guiCreateButton(10,549,181,37,"Empezar a Jugar",false,GUIEditor_Window[1]) 
GUIEditor_Label[1] = guiCreateLabel(25,65,113,21,"Escoge el ID ",false,GUIEditor_Window[1]) 
guiSetFont(GUIEditor_Label[1],"default-bold-small") 
GUIEditor_Button[5] = guiCreateButton(9,31,182,32,"Crear nuevo personaje",false,GUIEditor_Window[1]) 
guiSetFont(GUIEditor_Label[1],"default-bold-small") 
GUIEditor_Grid[1] = guiCreateGridList(9,82,182,463,false,GUIEditor_Window[1]) 
guiGridListSetSelectionMode(GUIEditor_Grid[1],2) 
  
column = guiGridListAddColumn(GUIEditor_Grid[1],"ID",0.7) 
  
GUIEditor_Window[2] = guiCreateWindow(0,0,0.245,0.4567,"GUI Seleccion",true) 
guiWindowSetMovable(GUIEditor_Window[2],false) 
guiWindowSetSizable(GUIEditor_Window[2],false) 
GUIEditor_Button[2] = guiCreateButton(23,36,57,31,"<",false,GUIEditor_Window[2]) 
GUIEditor_Button[3] = guiCreateButton(80,36,57,31,">",false,GUIEditor_Window[2]) 
GUIEditor_Label[2] = guiCreateLabel(27,78,100,22,"NameTag Color",false,GUIEditor_Window[2]) 
GUIEditor_Edit[1] = guiCreateEdit(65,98,61,23,"",false,GUIEditor_Window[2]) 
guiEditSetMaxLength(GUIEditor_Edit[1],3) 
GUIEditor_Label[3] = guiCreateLabel(52,101,9,15,"R",false,GUIEditor_Window[2]) 
guiLabelSetColor(GUIEditor_Label[3],255,0,0) 
GUIEditor_Edit[2] = guiCreateEdit(65,123,61,23,"",false,GUIEditor_Window[2]) 
guiEditSetMaxLength(GUIEditor_Edit[2],3) 
GUIEditor_Label[4] = guiCreateLabel(52,127,9,15,"G",false,GUIEditor_Window[2]) 
guiLabelSetColor(GUIEditor_Label[4],0,255,0) 
GUIEditor_Edit[3] = guiCreateEdit(65,147,61,23,"",false,GUIEditor_Window[2]) 
GUIEditor_Label[5] = guiCreateLabel(52,151,9,15,"B",false,GUIEditor_Window[2]) 
guiLabelSetColor(GUIEditor_Label[5],0,0,255) 
GUIEditor_Label[6] = guiCreateLabel(9,189,83,17,"Nombre del ID",false,GUIEditor_Window[2]) 
GUIEditor_Edit[4] = guiCreateEdit(96,186,91,23,"",false,GUIEditor_Window[2]) 
GUIEditor_Button[4] = guiCreateButton(9,230,169,28,"Crear Personaje/ID",false,GUIEditor_Window[2]) 
  
guiSetVisible(GUIEditor_Window[1],false) 
guiSetVisible(GUIEditor_Window[2],false) 
guiSetVisible(GUIEditor_Button[5],false) 
showCursor(false) 
  
addEvent("onVisible",true) 
addEventHandler("onVisible", getLocalPlayer(),  
function() 
guiSetVisible(GUIEditor_Window[1],true) 
guiSetVisible(GUIEditor_Window[2],true) 
showPlayerHudComponent ("radar",false) 
showCursor(true) 
guiSetInputMode("no_binds_when_editing") 
triggerServerEvent("onCameraMatrix", getLocalPlayer()) 
ped = createPed( 0, -1586.671875, 1351.53125, 8.2823114395142 ) 
end 
) 
  
addEventHandler("onClientGUIClick", root,  
function() 
if source == GUIEditor_Button[1] then 
guiSetVisible(GUIEditor_Window[1],false) 
guiSetVisible(GUIEditor_Window[2],false) 
showCursor(false) 
setElementPosition( localPlayer, 2580.7265625, 2328.77734375, 17.822208404541) 
destroyElement(ped) 
setCameraTarget( localPlayer ) 
setPlayerNametagColor ( localPlayer, tonumber ( guiGetText ( GUIEditor_Edit[1] ) ), tonumber ( guiGetText ( GUIEditor_Edit[2] ) ), tonumber ( guiGetText ( GUIEditor_Edit[3] ) ) ) 
showPlayerHudComponent ("radar",true) 
end 
end 
) 
  
function rotateTempPed ( ) 
    if isElement ( ped ) then 
        rotation = rotation + 1 
        if ( rotation > 359 ) then 
            rotation = 0 
        end 
  
        setPedRotation ( ped, rotation ) 
    end 
end 
addEventHandler("onClientRender", root, rotateTempPed) 
  
  
  
numero = 0 
  
function on_pushButton_2_clicked(button,state) 
    if (button == "left" and state == "up") then 
    if(numero == 1) then return end 
    numero = numero - 1 
    setElementModel(ped,numero) 
    
    end 
end 
addEventHandler("onClientGUIClick", GUIEditor_Button[2], on_pushButton_2_clicked) 
  
function on_pushButton_3_clicked(button,state) 
    if (button == "left" and state == "up") then 
    if (numero == 200) then return end 
    numero = numero + 1 
    setElementModel(ped,numero) 
    end 
end 
addEventHandler("onClientGUIClick", GUIEditor_Button[3], on_pushButton_3_clicked) 
  
addEventHandler("onClientGUIClick", root,  
function() 
if source == GUIEditor_Button[4] then 
guiSetVisible(GUIEditor_Window[2],false) 
guiSetVisible(GUIEditor_Button[5],true) 
local row = guiGridListAddRow ( GUIEditor_Grid[1] ) 
guiGridListSetItemColor(GUIEditor_Grid[1], row, column, (guiGetText(GUIEditor_Edit[1])), (guiGetText(GUIEditor_Edit[2])), (guiGetText(GUIEditor_Edit[3]))) 
guiGridListSetItemText(GUIEditor_Grid[1], row, column, (guiGetText(GUIEditor_Edit[4])), false, false) 
end 
end 
) 
  
addEvent("onClientGetModel", true) 
addEventHandler("onClientGetModel", getModel,  
function() 
getModel = getElementModel(ped) 
end 
) 

le aparece nuevamente *-*

Link to comment

soren ya ise para que al aparecer aparesca con el mismo skin del ped ahora falta que se guarde nomas :P

GUIEditor_Window = {} 
GUIEditor_Button = {} 
GUIEditor_Label = {} 
GUIEditor_Edit = {} 
GUIEditor_Grid = {} 
rotation = 0 
  
GUIEditor_Window[1] = guiCreateWindow(0.75,0,0.25,0.9967,"GUI IDs",true) 
guiWindowSetMovable(GUIEditor_Window[1],false) 
guiWindowSetSizable(GUIEditor_Window[1],false) 
GUIEditor_Button[1] = guiCreateButton(10,549,181,37,"Empezar a Jugar",false,GUIEditor_Window[1]) 
GUIEditor_Label[1] = guiCreateLabel(25,65,113,21,"Escoge el ID ",false,GUIEditor_Window[1]) 
guiSetFont(GUIEditor_Label[1],"default-bold-small") 
GUIEditor_Button[5] = guiCreateButton(9,31,182,32,"Crear nuevo personaje",false,GUIEditor_Window[1]) 
guiSetFont(GUIEditor_Label[1],"default-bold-small") 
GUIEditor_Grid[1] = guiCreateGridList(9,82,182,463,false,GUIEditor_Window[1]) 
guiGridListSetSelectionMode(GUIEditor_Grid[1],2) 
  
column = guiGridListAddColumn(GUIEditor_Grid[1],"ID",0.7) 
  
GUIEditor_Window[2] = guiCreateWindow(0,0,0.245,0.4567,"GUI Seleccion",true) 
guiWindowSetMovable(GUIEditor_Window[2],false) 
guiWindowSetSizable(GUIEditor_Window[2],false) 
GUIEditor_Button[2] = guiCreateButton(23,36,57,31,"<",false,GUIEditor_Window[2]) 
GUIEditor_Button[3] = guiCreateButton(80,36,57,31,">",false,GUIEditor_Window[2]) 
GUIEditor_Label[2] = guiCreateLabel(27,78,100,22,"NameTag Color",false,GUIEditor_Window[2]) 
GUIEditor_Edit[1] = guiCreateEdit(65,98,61,23,"",false,GUIEditor_Window[2]) 
guiEditSetMaxLength(GUIEditor_Edit[1],3) 
GUIEditor_Label[3] = guiCreateLabel(52,101,9,15,"R",false,GUIEditor_Window[2]) 
guiLabelSetColor(GUIEditor_Label[3],255,0,0) 
GUIEditor_Edit[2] = guiCreateEdit(65,123,61,23,"",false,GUIEditor_Window[2]) 
guiEditSetMaxLength(GUIEditor_Edit[2],3) 
GUIEditor_Label[4] = guiCreateLabel(52,127,9,15,"G",false,GUIEditor_Window[2]) 
guiLabelSetColor(GUIEditor_Label[4],0,255,0) 
GUIEditor_Edit[3] = guiCreateEdit(65,147,61,23,"",false,GUIEditor_Window[2]) 
GUIEditor_Label[5] = guiCreateLabel(52,151,9,15,"B",false,GUIEditor_Window[2]) 
guiLabelSetColor(GUIEditor_Label[5],0,0,255) 
GUIEditor_Label[6] = guiCreateLabel(9,189,83,17,"Nombre del ID",false,GUIEditor_Window[2]) 
GUIEditor_Edit[4] = guiCreateEdit(96,186,91,23,"",false,GUIEditor_Window[2]) 
GUIEditor_Button[4] = guiCreateButton(9,230,169,28,"Crear Personaje/ID",false,GUIEditor_Window[2]) 
  
guiSetVisible(GUIEditor_Window[1],false) 
guiSetVisible(GUIEditor_Window[2],false) 
guiSetVisible(GUIEditor_Button[5],false) 
showCursor(false) 
  
addEvent("onVisible",true) 
addEventHandler("onVisible", getLocalPlayer(),  
function() 
guiSetVisible(GUIEditor_Window[1],true) 
guiSetVisible(GUIEditor_Window[2],true) 
showPlayerHudComponent ("radar",false) 
showCursor(true) 
guiSetInputMode("no_binds_when_editing") 
triggerServerEvent("onCameraMatrix", getLocalPlayer()) 
ped = createPed( 0, -1586.671875, 1351.53125, 8.2823114395142 ) 
end 
) 
  
addEventHandler("onClientGUIClick", root,  
function() 
if source == GUIEditor_Button[1] then 
guiSetVisible(GUIEditor_Window[1],false) 
guiSetVisible(GUIEditor_Window[2],false) 
setCameraTarget( localPlayer ) 
showCursor(false) 
setElementPosition( localPlayer, 2580.7265625, 2328.77734375, 17.822208404541) 
local skin = getElementModel( ped ) 
setElementModel( localPlayer, tonumber(skin) ) 
destroyElement(ped) 
setPlayerNametagColor ( localPlayer, tonumber ( guiGetText ( GUIEditor_Edit[1] ) ), tonumber ( guiGetText ( GUIEditor_Edit[2] ) ), tonumber ( guiGetText ( GUIEditor_Edit[3] ) ) ) 
showPlayerHudComponent ("radar",true) 
end 
end 
) 
  
function rotateTempPed ( ) 
    if isElement ( ped ) then 
        rotation = rotation + 1 
        if ( rotation > 359 ) then 
            rotation = 0 
        end 
  
        setPedRotation ( ped, rotation ) 
    end 
end 
addEventHandler("onClientRender", root, rotateTempPed) 
  
  
  
numero = 0 
  
function on_pushButton_2_clicked(button,state) 
    if (button == "left" and state == "up") then 
    if(numero == 1) then return end 
    numero = numero - 1 
    setElementModel(ped,numero) 
    
    end 
end 
addEventHandler("onClientGUIClick", GUIEditor_Button[2], on_pushButton_2_clicked) 
  
function on_pushButton_3_clicked(button,state) 
    if (button == "left" and state == "up") then 
    if (numero == 200) then return end 
    numero = numero + 1 
    setElementModel(ped,numero) 
    end 
end 
addEventHandler("onClientGUIClick", GUIEditor_Button[3], on_pushButton_3_clicked) 
  
addEventHandler("onClientGUIClick", root,  
function() 
if source == GUIEditor_Button[4] then 
guiSetVisible(GUIEditor_Window[2],false) 
guiSetVisible(GUIEditor_Button[5],true) 
local row = guiGridListAddRow ( GUIEditor_Grid[1] ) 
guiGridListSetItemColor(GUIEditor_Grid[1], row, column, (guiGetText(GUIEditor_Edit[1])), (guiGetText(GUIEditor_Edit[2])), (guiGetText(GUIEditor_Edit[3]))) 
guiGridListSetItemText(GUIEditor_Grid[1], row, column, (guiGetText(GUIEditor_Edit[4])), false, false) 
end 
end 
) 
  
addEvent("onClientGetModel", true) 
addEventHandler("onClientGetModel", getModel,  
function() 
getModel = getElementModel(ped) 
end 
) 

Link to comment
  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...