SQL issue
#1

Hey, so Ive created this small character system (currently supports 1 character only), im only now wondering how to load the character for the player? Ive created MasterID for characters but Ive got no luck to get the player name, or any informations.

pawn Код:
mysql_format(mysql, query, sizeof(query), "SELECT `PlayerName` FROM `characters` WHERE `MasterID` = '%d' LIMIT 1", AccInfo[playerid][ID]);
                mysql_tquery(mysql, query, "OnCharacterLoad", "i", playerid);

public OnCharacterLoad(playerid)
{
    CharInfo[playerid][PlayerName] = cache_get_field_name(0,"PlayerName");
    CharInfo[playerid][Age] = cache_get_field_content_int(0, "Age");
    CharInfo[playerid][Sex] = cache_get_field_content_int(0, "Sex");
    return true;
}

Im not any good with SQL, but basically what Im trying to do is:
1. Look for Player name (table characters) thats MasterID is same as AccInfo[playerid][ID]
Reply


Messages In This Thread
SQL issue - by TwinkiDaBoss - 19.11.2015, 21:09
Re: SQL issue - by Jefff - 19.11.2015, 22:16
Re: SQL issue - by TwinkiDaBoss - 19.11.2015, 22:27
Re: SQL issue - by Jefff - 19.11.2015, 22:29
Re: SQL issue - by TwinkiDaBoss - 19.11.2015, 22:30

Forum Jump:


Users browsing this thread: 2 Guest(s)