[ayuda] agregar staff sv rp
#1

Edit* para ahorrar espacio
Reply
#2

Creo que confundes 'Staff' con 'Stats', debes buscar la parte en la que te registras y poner la funciуn que hiciste.
Reply
#3

resuelto esto, ahora tengo problema con el skin
Reply
#4

no setea el skin ayuda, le coloco que me de el skin 60 y aparesco es con el de cj ((

Код:
forward OnQueryFinish(resultid, extraid, ConnectionHandle);
public OnQueryFinish(resultid, extraid, ConnectionHandle)
{
    new Rows, Field, string[256];
    if(resultid != 0)
    {
        cache_get_data(Rows, Field);
    }
    switch(resultid)
    {
        case 1:
        {
            if(Rows == 1)
            {
                new content[1000];
               	cache_get_field_content(0, "Password", PlayerInfo[extraid][pPassword]);
                cache_get_field_content(0, "Score", content); PlayerInfo[extraid][pScore] = strval(content);
                cache_get_field_content(0, "Trabajotaxi", content); PlayerInfo[extraid][Trabajotaxi] = strval(content);
                cache_get_field_content(0, "Vida", content); PlayerInfo[extraid][pVida] = floatstr(content);
                cache_get_field_content(0, "Chaleco", content); PlayerInfo[extraid][pChaleco] = floatstr(content);
                cache_get_field_content(0, "Posx", content); PlayerInfo[extraid][pPosx] = floatstr(content);
                cache_get_field_content(0, "Posy", content); PlayerInfo[extraid][pPosy] = floatstr(content);
                cache_get_field_content(0, "Posz", content); PlayerInfo[extraid][pPosz] = floatstr(content);
                cache_get_field_content(0, "NuevoUsuario", content); NuevoUsuario[extraid] = strval(content);
                cache_get_field_content(0, "Skin", content); PlayerInfo[extraid][pSkin] = strval(content);
                
                //ColocarJugador(extraid);
                if(NuevoUsuario[extraid] >= 1)
                {
                    SetSpawnInfo(extraid,0,0,-1982.2260,137.6877,27.6875,0,0,0,0,0,0,0);
                    SetPlayerPos(extraid,-1982.2260,137.6877,27.6875);
                    SetPlayerSkin(extraid, 60);
                    SetPlayerSkin(extraid, 60);
                    NuevoUsuario[extraid] = 0;
                }
                else
                {
                	SetSpawnInfo(extraid,0,0, PlayerInfo[extraid][pPosx],PlayerInfo[extraid][pPosy],PlayerInfo[extraid][pPosz],0.0,0,0,0,0,0,0);
               	 	SetPlayerSkin(extraid, PlayerInfo[extraid][pSkin]);
                }
                
                
				//SetPlayerHealth(extraid, PlayerInfo[extraid][pVida]);
   				SetPlayerArmour(extraid, PlayerInfo[extraid][pChaleco]);
   				SetPlayerScore(extraid, PlayerInfo[extraid][pScore]);

                
              	//SetSpawnInfo(extraid,0,0, PlayerInfo[extraid][pPosx],PlayerInfo[extraid][pPosy],PlayerInfo[extraid][pPosz],0.0,0,0,0,0,0,0);
               	//SetPlayerScore(extraid,  PlayerInfo[extraid][pScore]);
                //SetPlayerArmour(extraid, PlayerInfo[extraid][pChaleco]);
                //SetPlayerHealth(extraid, PlayerInfo[extraid][pVida]);
                //SpawnPlayer(extraid);
            }
            else if(!Rows)
            {
               //
            }
        }
        case 2:
        {
            NuevoUsuario[extraid] = 1;
            if(Rows == 1)
            {
                new pName[24]; GetPlayerName(extraid, pName, 24);
                cache_get_field_content(0, "Password", PlayerInfo[extraid][pPassword]);
                format(string, sizeof(string), "El personaje %s estб registrado en la base de datos. Pon los datos para iniciar sesiуn:", pName);
                ShowPlayerDialog(extraid, LOGIN, DIALOG_STYLE_PASSWORD,"Login",string,"Enviar","Salir");
                
            }
            else if(!Rows)
            {
                new pName[24]; GetPlayerName(extraid, pName, 24);
                format(string, sizeof(string), "El jugador %s no estб registrado en el servidor, pon aquн la contraseсa para registrarlo:", pName);
                ShowPlayerDialog(extraid, REGISTRO, DIALOG_STYLE_PASSWORD,"Registro:",string,"Enviar","Salir");
				
            }
        }
    }
    return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    new string[256];
    new pName[24], Query[256]; GetPlayerName(playerid, pName, 24);
    switch(dialogid)
    {
        case LOGIN:
        {
            if(!response)
            {
                Kick(playerid);
            }
            if(strcmp(PlayerInfo[playerid][pPassword], inputtext, true, 128) == 0)
            {
                format(Query, sizeof(Query), "SELECT * FROM `usuarios` WHERE `Nombre` = '%s'", pName);
                mysql_function_query(Conecction, Query, true, "OnQueryFinish", "ii", 1, playerid);
                //ColocarJugador(playerid);
             	//SetPlayerHealth(playerid, PlayerInfo[playerid][pVida]);
   				//SetPlayerArmour(playerid, PlayerInfo[playerid][pChaleco]);
   				//SetPlayerScore(playerid, PlayerInfo[playerid][pScore]);
   				if(NuevoUsuario[playerid] >= 1)
                {
                	SetSpawnInfo(playerid,0,0,-1982.2260,137.6877,27.6875,0,0,0,0,0,0,0);
                    SetPlayerPos(playerid,-1982.2260,137.6877,27.6875);
                   	SetPlayerSkin(playerid, 60);
                    NuevoUsuario[playerid] = 0;
                }
                else
                {
                    SetSpawnInfo(playerid,0,0, PlayerInfo[playerid][pPosx],PlayerInfo[playerid][pPosy],PlayerInfo[playerid][pPosz],0.0,0,0,0,0,0,0);
                    SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]);
               	}
				SpawnPlayer(playerid);
            }
            else
            {
                SendClientMessage(playerid, -1, "CONTRASEСA INCORRECTA");
                Kick(playerid);
            }
         
        }
        case REGISTRO:
        {
            if(!response)
            {
                SendClientMessage(playerid, -1, "Kicked");
                Kick(playerid);
            }
            if(response)
            {
                if(!strlen(inputtext))
                {
                    Kick(playerid);
                }
                new string2[128];
                format(string2, sizeof(string2), "%s", inputtext); PlayerInfo[playerid][pPassword] = string2;
                format(Query, sizeof(Query), "INSERT INTO `usuarios` (Nombre, Password) VALUES ('%s', '%s')",pName, PlayerInfo[playerid][pPassword]);
                mysql_function_query(Conecction, Query, true, "OnQueryFinish", "ii", 0, playerid);
                format(string, sizeof(string), "Has registrado el personaje %s en nuestro servidor.\n\nAhora inicia sesiуn", pName);
                ShowPlayerDialog(playerid, LOGIN, DIALOG_STYLE_PASSWORD,"Iniciar sesiуn",string,"Enviar","Salir");
                NuevoUsuario[playerid] = 1;
            }
        }
    }
    return 1;
}
Reply
#5

Cambia:

pawn Код:
SetSpawnInfo(playerid,0,0,-1982.2260,137.6877,27.6875,0,0,0,0,0,0,0);
por

pawn Код:
SetSpawnInfo(playerid,0,60,-1982.2260,137.6877,27.6875,0,0,0,0,0,0,0);
Reply
#6

funciona ahora otro problema... no guarda el skin en la base de datos

Код:
forward SaveAccount(playerid);public SaveAccount(playerid)
{
    new query[1000];GetPlayerPos(playerid, PlayerInfo[playerid][pPosx], PlayerInfo[playerid][pPosy], PlayerInfo[playerid][pPosz]);
    new pName[24]; GetPlayerName(playerid, pName, 24); GetPlayerHealth(playerid, PlayerInfo[playerid][pVida]), GetPlayerArmour(playerid, PlayerInfo[playerid][pChaleco]), GetPlayerSkin(PlayerInfo[playerid][pSkin]);
    format(query, 1000, "UPDATE `usuarios` SET `Vida`='%f', `Chaleco`='%f', `Admin`='%d', `Score`='%d',`Posx`='%f', `Posy`='%f',`Posz`='%f',`NuevoUsuario`='%d', `Trabajotaxi`='%d',`Skin`='%d'  WHERE `Nombre`='%s'", PlayerInfo[playerid][pVida], PlayerInfo[playerid][pChaleco],
    PlayerInfo[playerid][pAdmin], PlayerInfo[playerid][pScore], PlayerInfo[playerid][pPosx], PlayerInfo[playerid][pPosy], PlayerInfo[playerid][pPosz], NuevoUsuario[playerid],PlayerInfo[playerid][Trabajotaxi],PlayerInfo[playerid][pSkin], pName);
    mysql_function_query(Conecction, query, true, "OnQueryFinish", "ii", 0, playerid);
    return 1;
}
:/
Reply
#7

No edites los mensajes, si alguien tiene el mismo problema tendrб que hacer otro post. Da bastante rabia cuando hacen eso.
Reply
#8

No guarda skin en database D:
Reply
#9

upp (((((
Reply
#10

Quote:

forward SaveAccount(playerid);public SaveAccount(playerid)
{
new query[1000], pName[24];
GetPlayerPos(playerid, PlayerInfo[playerid][pPosx], PlayerInfo[playerid][pPosy], PlayerInfo[playerid][pPosz]);
GetPlayerName(playerid, pName, 24);
GetPlayerHealth(playerid, PlayerInfo[playerid][pVida]);
GetPlayerArmour(playerid, PlayerInfo[playerid][pChaleco]);
GetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]);

format(query, 1000, "UPDATE `usuarios` SET `Vida`='%f', `Chaleco`='%f', `Admin`='%d', `Score`='%d',`Posx`='%f', `Posy`='%f',`Posz`='%f',`NuevoUsuario`='%d', `Trabajotaxi`='%d',`Skin`='%d' WHERE `Nombre`='%s'", PlayerInfo[playerid][pVida], PlayerInfo[playerid][pChaleco],
PlayerInfo[playerid][pAdmin], PlayerInfo[playerid][pScore], PlayerInfo[playerid][pPosx], PlayerInfo[playerid][pPosy], PlayerInfo[playerid][pPosz], NuevoUsuario[playerid],PlayerInfo[playerid][Trabajotaxi],PlayerInfo[playerid][pSkin], pName);
mysql_function_query(Conecction, query, true, "OnQueryFinish", "ii", 0, playerid);
return 1;
}

Prueba asн, te falto el parametro playerid al GetPlayerSkin...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)