Insusses
#1

'From here' 'To here' bugs the MySQL items...
So how to fix :S


if i do "/*" and "*/" Between 'From here' and 'To here' then the MySQL works smooth :P

pawn Код:
public OnPlayerConnect(playerid)
{
    //I got something here
    //I got something here
    //I got something here
    //Ect...

    //From here
    new IP[16], servername[128], string[66], playername[MAX_PLAYER_NAME];
    GetPlayerIp(playerid, IP, sizeof(IP));
    GetPlayerName(playerid, playername, sizeof(playername));
    GetServerVarAsString("hostname", servername, sizeof(servername));
   
    for(new i; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerAdmin(i))
        {
            format(string, sizeof(string), "%s(%d) Has Joined %s. (IP: %s)", playername, playerid, servername,IP);
            SendClientMessage(i, 0x808080FF, string);
        }
        else
        {
            format(string, sizeof(string), "%s(%d) Has Joined %s.", playername, playerid, servername);
            SendClientMessage(i, 0x808080FF, string);
        }
    }
    //To here

    //I got some TextDraws here
    //I got some TextDraws here
    //I got some TextDraws here

    //I got MySQL things here
    //I got MySQL things here
    return 1;
}
Reply
#2

string cell is most likley to small.
never insert a larger string(servername) into a smaller one(string)
Reply
#3

Quote:
Originally Posted by MaXSpeeD
Посмотреть сообщение
string cell is most likley to small.
never insert a larger string(servername) into a smaller one(string)
Thank You

Now i have another problem too, "sscanf warning: String buffer overflow." That message prints in console when i login (MySQL saving)
Reply
#4

Bring
Up
My
Post
Reply
#5

i got a problem, "sscanf warning: String buffer overflow." That message prints in console when i login (MySQL saving)

What is this? :S
Reply
#6

like maxspeed said "the string size is too small"
Reply
#7

I cant see anything worng here... =/ Maybe i need glasses, or??

pawn Код:
new row[265];
                    mysql_fetch_row(row, "|");
                    new name[MAX_PLAYER_NAME], IP[16], score, cash, dateJoined, timeonserver[12];
                    sscanf(row, "p<|>s[24]s[145]s[16]dddddds[28]s[11]",name,escape,IP,PlayerData[playerid][AdminLevel],score,cash,PlayerData[playerid][BankMoney],PlayerData[playerid][Kills],PlayerData[playerid][Deaths],dateJoined,timeonserver);
Reply
#8

Quote:
Originally Posted by Unknown123
Signature.
You're signature made my day.
Reply
#9

Quote:
Originally Posted by Unknown123
Посмотреть сообщение
i got a problem, "sscanf warning: String buffer overflow." That message prints in console when i login (MySQL saving)

What is this? :S
Quote:
Originally Posted by sansko
Посмотреть сообщение
like maxspeed said "the string size is too small"
When you gonna use a string in sscanf you must do this.
pawn Код:
new string[128];
if (sscanf(params,"s[128]",string)) return SendClientMessage(playerid,COLOR,"USAGE: /mycommand [string]");
Reply
#10

Quote:
Originally Posted by Marricio
Посмотреть сообщение
When you gonna use a string in sscanf you must do this.
pawn Код:
new string[128];
if (sscanf(params,"s[128]",string)) return SendClientMessage(playerid,COLOR,"USAGE: /mycommand [string]");
...I know that... But i dont see anything wrong with the code..

Anyway i showed wrong part of my code...:

pawn Код:
new row[265];
mysql_fetch_row(row, "|");
new name[MAX_PLAYER_NAME], IP[16], score, cash, dateJoined, timeonserver[12];
sscanf(row, "p<|>s[24]s[145]s[16]dddddds[28]s[11]",name,escape,IP,PlayerData[playerid][AdminLevel],score,cash,PlayerData[playerid][BankMoney],PlayerData[playerid][Kills],PlayerData[playerid][Deaths],dateJoined,timeonserver);
Reply


Forum Jump:


Users browsing this thread: