Jump to content

Character system


Soren

Recommended Posts

Posted

Hola a todos, hice este topic para reunir a todos los que me quieran ayudar a crear un sistema de personajes los que me ayuden tendran todo el permiso de utilisarlo en su server.

Primero que es lo que necesitariamos primero? un gui cierto? Mmm.

Diganme que debo ponerle al gui y yo lo hago.

Porfavor necesito su ayuda. Diganme que necesita el primer Gui.

Tbm pondremos un camara matrix para que se vea como esta quedando el jugador. eh intentare que se salve en SQL

  • Replies 110
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted
Hola a todos, hice este topic para reunir a todos los que me quieran ayudar a crear un sistema de personajes los que me ayuden tendran todo el permiso de utilisarlo en su server.

Primero que es lo que necesitariamos primero? un gui cierto? Mmm.

Diganme que debo ponerle al gui y yo lo hago.

Porfavor necesito su ayuda. Diganme que necesita el primer Gui.

'

Tbm pondremos un camara matrix para que se vea como esta quedando el jugador. eh intentare que se salve en SQL

Hablas de todo un sistema o crear CJ's con distinta ropa?

Posted
El gui lo podemos hacer tu y yo y despues yo testeo

ahh con skins, usa las funciones para cambiar los skin y guardalos por id en las account.

Posted

Listo :)

dime si te gusta o no :) ahora ai q poner los eventos

GUIEditor_Window = {} 
GUIEditor_Button = {} 
GUIEditor_Label = {} 
GUIEditor_Edit = {} 
GUIEditor_Grid = {} 
  
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) 
  
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.2475,0.4167,"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]) 

Aqui una IMG dime si te gusta o no :)

mtascreen20120429111937.png

Posted

no, te sale un camera matrix y si uno presiona un boton se devuelve al skin que tenias y si uno presiona > es otro skin xD no se si me entendes y gracias por el cumplido :)

Posted

Mota eres el Davinci de los Gui's! esta del 100!

Ahora :/ hay que scriptear el primer evento de crear personajes.

Edi sabes como empezar?

Posted (edited)

ya llevo un poco me falta crear el ped el set camera ponerle evento a los botones y listo

GUIEditor_Window = {} 
GUIEditor_Button = {} 
GUIEditor_Label = {} 
GUIEditor_Edit = {} 
GUIEditor_Grid = {} 
  
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) 
  
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) 
showCursor(true) 
setCameraMatrix(-1570.66796875, 1358.087890625, 11.218300819397 
end 
) 
  
addEventHandler("onClientGUIClick", root,  
function() 
if source == GUIEditor_Button[1] then 
guiSetVisible(GUIEditor_Window[1],false) 
guiSetVisible(GUIEditor_Window[2],false) 
showCursor(true) 
setElementPosition( localPlayer, 2580.7265625, 2328.77734375, 17.822208404541) 
end 
end 
) 

como ves estoy creando el setcamera matrix xDD

sv-side

addEventHandler("onPlayerLogin", getRootElement(),  
function() 
triggerClientEvent("onVisible", getRootElement()) 
end 
) 

xDD

Edited by Guest
Posted (edited)

Osea, que cuando loguea si el tipo no tiene personaje creado le aparezca esto?

Eu mota , no pongas getRootElement() pone

triggerClientEvent(source,"onVisible",source) 

Edited by Guest
Posted

Si, si no tiene personajes creados que ponga que tiene que hacerse 1, y si tiene que salga en la columna que hiso el mota.

Tmb seria bueno poner limite de 3 personajes por cuenta

Posted

Habria que hacer una tabla SQL lo mejor

  
  
executeSQLQuery("CREATE TABLE IF NOT EXISTS personajes (ID STRING,NickName STRING,Skin STRING)") 
  
  

Eso es una opcion, que cada fila sea un personaje, y la ID es el nombre del account. Para saber cuantos tiene, hace falta solo poner

executeSQLQuery("SELECT * FROM personajes WHERE ID = '"..accountName.."'") 

Posted (edited)

llevo esto asta ahora

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) 
  
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) 
showCursor(true) 
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) 
setCameraTarget( localPlayer ) 
end 
end 
) 
  
function rotateTempPed ( ) 
    if isElement ( ped ) then 
        rotation = rotation + 1 
        if ( rotation > 359 ) then 
            rotation = 0 
        end 
  
        setPedRotation ( ped, rotation ) 
    end 
end 

sv-side

addEventHandler("onPlayerLogin", getRootElement(),  
function() 
triggerClientEvent("onVisible", getRootElement()) 
end 
) 
  
addEvent("onCameraMatrix", true) 
addEventHandler("onCameraMatrix", getRootElement(),  
function() 
setCameraMatrix( source, -1570.66796875, 1358.087890625, 11.218300819397, -1586.671875, 1351.53125, 8.2823114395142 ) 
end 
) 

:) no me funciona la function de rotacion :/

Edited by Guest
Posted

Es muy facil, pensalo como una tabla de Excel >

Lo que esta arriba son las columnas, a les que llamamos "ID" "NickName" "Skin".

De ahi, vos insertas filas que son las que van enumeradas en Excel. Aca para identificar cada fila, le agregamos una ID que es el accountName ya que se denomina como propio.

Por ende, lo demas es todo un sistema de consulta : seleccionar, insertar, borrar, crear

Posted
:P no se no entiendo nada acerca de eso de la rotacion eso lo saque de otro script mio que era una tienda de skins y funcionaba perfecto asi
Posted
:P no se no entiendo nada acerca de eso de la rotacion eso lo saque de otro script mio que era una tienda de skins y funcionaba perfecto asi , ademas no se como hacerle para que al precionar un boton aga otro skin :P
  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...