SA-MP Forums Archive
Insusses - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Insusses (/showthread.php?tid=228087)



Issues - Unknown123 - 18.02.2011

'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;
}



Re: Insusses - MaXSpeeD - 18.02.2011

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


Re: Insusses - Unknown123 - 19.02.2011

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)


Re: Insusses - Unknown123 - 20.02.2011

Bring
Up
My
Post


Re: Insusses - Unknown123 - 21.02.2011

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

What is this? :S


Re: Insusses - sansko - 21.02.2011

like maxspeed said "the string size is too small"


Re: Insusses - Unknown123 - 21.02.2011

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);



Re: Insusses - Cameltoe - 21.02.2011

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


Re: Insusses - Marricio - 21.02.2011

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]");



Re: Insusses - Unknown123 - 21.02.2011

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);