Get information for mysql
#24

Quote:
Originally Posted by JaTochNietDan
It's very simple, just add the #define dcmd code which you can find on the forums, and also the sscanf function, trust me, its alot better than using strtok.
thx i define this in my gm

Код:
#define dcmd(%1,%2,%3) if (!strcmp((%3)[1], #%1, true, (%2)) && ((((%3)[(%2) + 1] == '\0') && (dcmd_%1(playerid, ""))) || (((%3)[(%2) + 1] == ' ') && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
The problem its now this when i compile

Код:
C:\Documents and Settings\Administrador\Mis documentos\Samp Server\gamemodes\nfs.pwn(459) : error 017: undefined symbol "dcmd_login"
C:\Documents and Settings\Administrador\Mis documentos\Samp Server\gamemodes\nfs.pwn(462) : error 017: undefined symbol "sscanf"
C:\Documents and Settings\Administrador\Mis documentos\Samp Server\gamemodes\nfs.pwn(474) : warning 204: symbol is assigned a value that is never used: "logueado"
Here is my pawn code

pawn Код:
dcmd_login(playerid,params[])
    {
    new password[20];
    if(sscanf(params,"s",password)) SendClientMessage(playerid,COLOR_GREY,"Utiliza: /login <password>");
    else
    {
        new query[128];
      new name[24];
        GetPlayerName(playerid,name,sizeof(name));
            samp_mysql_real_escape_string(password,password);
        format(query,sizeof(query),"SELECT id FROM `players` WHERE Nombre = '%s' AND Password = '%s'",name,password);
        samp_mysql_query(query);
        samp_mysql_store_result();
        if(samp_mysql_num_rows() > 0)
        {
            logueado = 1;
                SendClientMessage(playerid, COLOR_GREEN, "________________________________________________________");
                SendClientMessage(playerid, COLOR_YELLOW, "Has sido logueado correctamente.");
            SendClientMessage(playerid, COLOR_GREEN, "________________________________________________________");
        }
        else
            {
                if(intentos == 3)
                {
                SendClientMessage(playerid, COLOR_GREEN, "________________________________________________________");
                    SendClientMessage(playerid, COLOR_YELLOW, "Limites de intentos por contraseсa. Has sido Kickeado.");
                SendClientMessage(playerid, COLOR_GREEN, "________________________________________________________");
                    Kick(playerid);
                }
            else
            {
                intentos = intentos +1;
                SendClientMessage(playerid, COLOR_GREEN, "_________________________________________");
                SendClientMessage(playerid, COLOR_YELLOW, "Contraseсa incorrecta.");
                SendClientMessage(playerid, COLOR_GREEN, "_________________________________________");
            }
            }
    }
    }
Reply


Messages In This Thread
Get information for mysql - by Zafire1410 - 23.08.2009, 20:56
Re: Get information for mysql - by JaTochNietDan - 23.08.2009, 21:00
Re: Get information for mysql - by MenaceX^ - 23.08.2009, 21:00
Re: Get information for mysql - by Joe Staff - 23.08.2009, 21:11
Re: Get information for mysql - by Zafire1410 - 23.08.2009, 21:11
Re: Get information for mysql - by Zafire1410 - 23.08.2009, 21:28
Re: Get information for mysql - by JaTochNietDan - 23.08.2009, 21:32
Re: Get information for mysql - by Zafire1410 - 23.08.2009, 21:45
Re: Get information for mysql - by JaTochNietDan - 23.08.2009, 21:50
Re: Get information for mysql - by Zafire1410 - 23.08.2009, 21:51
Re: Get information for mysql - by Zafire1410 - 23.08.2009, 22:04
Re: Get information for mysql - by MenaceX^ - 23.08.2009, 22:04
Re: Get information for mysql - by JaTochNietDan - 23.08.2009, 22:12
Re: Get information for mysql - by Zafire1410 - 23.08.2009, 22:13
Re: Get information for mysql - by JaTochNietDan - 23.08.2009, 22:15
Re: Get information for mysql - by MenaceX^ - 23.08.2009, 22:17
Re: Get information for mysql - by JaTochNietDan - 23.08.2009, 22:20
Re: Get information for mysql - by Zafire1410 - 23.08.2009, 22:22
Re: Get information for mysql - by Zafire1410 - 23.08.2009, 22:25
Re: Get information for mysql - by MenaceX^ - 23.08.2009, 22:26
Re: Get information for mysql - by JaTochNietDan - 23.08.2009, 22:30
Re: Get information for mysql - by Zafire1410 - 23.08.2009, 22:34
Re: Get information for mysql - by JaTochNietDan - 23.08.2009, 22:36
Re: Get information for mysql - by Zafire1410 - 23.08.2009, 22:46
Re: Get information for mysql - by JaTochNietDan - 23.08.2009, 22:53
Re: Get information for mysql - by Zafire1410 - 23.08.2009, 23:01
Re: Get information for mysql - by JaTochNietDan - 23.08.2009, 23:03
Re: Get information for mysql - by Zafire1410 - 23.08.2009, 23:08
Re: Get information for mysql - by MenaceX^ - 23.08.2009, 23:16
Re: Get information for mysql - by Zafire1410 - 23.08.2009, 23:18

Forum Jump:


Users browsing this thread: 1 Guest(s)