SA-MP Forums Archive
COnvert to R33 - 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)
+--- Thread: COnvert to R33 (/showthread.php?tid=504629)



COnvert to R33 - Mriss - 05.04.2014

Hey COuld someone convert this script to mysql r33 please?
pawn Код:
CMD:top(playerid, params[])
{
    new playerData[512], clanname[MAX_PLAYER_NAME], string[512], clankills;
    mysql_query("SELECT `clanname`, `clankills` FROM `clans` ORDER BY `clankills`");
    mysql_store_result();
    while(mysql_retrieve_row())
    {
        mysql_fetch_row(playerData);
        sscanf(playerData, "p<|>s[512]d", clanname, clankills);
        // do something with 'playersName' and 'playersScore'
        format(string, sizeof(string), "%s\n"R"Clan: %s"W"Kills: %d", string, clanname, clankills);
        //SendClientMessage(playerid, ~1, string);
        ShowPlayerDialog( playerid, 1, DIALOG_STYLE_MSGBOX,"Location: Top Clans", string, "(Close)", "");
    }
    mysql_free_result();
    return 1;
}



Re: COnvert to R33 - Mriss - 05.04.2014

This is Urgent


Re: COnvert to R33 - Sithis - 05.04.2014

Check the r33 tutorials and documentation. I'm sure you can do this in less than 30 minutes. Maybe you'll even learn something along the way.


Re : COnvert to R33 - S4t3K - 05.04.2014

PHP код:
CMD:top(playeridparams[])
{
    new 
playerData[512], clanname[MAX_PLAYER_NAME], string[512], clankillsMySQL;
    
MySQL mysql_connect("localhost""root""ur_database""");
    
mysql_tquery(MySQL"SELECT `clanname`, `clankills` FROM `clans` ORDER BY `clankills`");
    while(
cache_retrieve_row()))
    {
        
mysql_fetch_row(playerData); // Don't know how to use it, sry
        
sscanf(playerData"p<|>s[512]d"clannameclankills);
        
format(stringsizeof(string), "%s\n"R"Clan: %s"W"Kills: %d"stringclannameclankills);
        
//SendClientMessage(playerid, ~1, string);
        
ShowPlayerDialogplayerid1DIALOG_STYLE_MSGBOX,"Location: Top Clans"string"(Close)""");
    }
    return 
1;