30.07.2016, 18:03
Can't I just assign Player[playerid][FactionName] = inputtext[120] under my dialogresponse.
Then call Player[playerid][FactionName] to UPDATE my `factionname` under my `account` table. i tried this and tried priting Player[playerid][FactionName] it prints me empty string. What am I doing wrong?
Under my command where i assign dialog is like this
Under enums, I have
Then call Player[playerid][FactionName] to UPDATE my `factionname` under my `account` table. i tried this and tried priting Player[playerid][FactionName] it prints me empty string. What am I doing wrong?
PHP код:
case factionnamed:
{
new query[500];
mysql_format(mysql,query,sizeof(query), "INSERT INTO `faction` (`factionname`) VALUES ('%e')",inputtext);
mysql_tquery(mysql, query, "callBackFunction", "i",playerid);
Player[playerid[FactionName] = inputtext[120];
mysql_format(mysql,query,sizeof(query), "UPDATE `accounts` SET `factionname` = %e `factionid` = %d WHERE ID %d LIMIT 1", Player[playerid][FactionName], Faction[playerid][ID], Player[playerid][ID]);
mysql_tquery(mysql,query,"","");
}
PHP код:
CMD:createfaction(playerid,params[])
{
if(Player[playerid][Admin] < 4) return SendClientMessage(playerid, COLOR_GREY, "You must be an adminstrator to use this command");
ShowPlayerDialog(playerid, factionnamed, DIALOG_STYLE_INPUT, "Faction Creation", "Enter the faction name", "Next","Cancel");
return 1;
}
PHP код:
enum PlayerData
{
ID,
Name[MAX_PLAYER_NAME],
Password[129],
IP[16],
Admin,
VIP,
FactionID,
FactionName[200],
Money,
Float:posX,
Float:posY,
Float:posZ,
Float:posA
};
new Player[MAX_PLAYERS][PlayerData];
PHP код:
enum FactionData
{
ID,
factionname[200],
factiontype
};
new Faction[MAX_PLAYERS][FactionData];