17.08.2017, 14:05
First of all Update does not really need to public or forward on your scenario you can just make that into a function,
Second of all why would you use pSQLID, on the adminx and pName on MoneyX? that's a little bit of confusing for both you and the readers.
Third of all
<- if you are not using the last two parts don't add the quotes, it just makes the process read the empty quotes and empty quotes would give out a value of 0 rather than letting the query think that it's a default -1.
Hope that helps
If it doesn't then, I have no more help to add..
Second of all why would you use pSQLID, on the adminx and pName on MoneyX? that's a little bit of confusing for both you and the readers.
Third of all
PHP код:
mysql_tquery(something here, something here, "", "");
Hope that helps
PHP код:
enum pInfo
{
pSQLID, pName[MAX_PLAYERS], pPassword, pAge, pAdmin, pHelper, pMoney
};
new PlayerInfo[MAX_PLAYERS][pInfo];
public Update(playerid, type)
{
if(IsPlayerConnected(playerid))
{
new query1[255];
{
switch(type)
{
case pAdminx:
{
mysql_format(g_Sql, query1, sizeof(query1), "UPDATE `users` SET `Admin` = '%d' WHERE `ID` = '%d'", PlayerInfo[playerid][pAdmin], PlayerInfo[playerid][pSQLID]);
mysql_tquery(g_Sql, query1, "", "");
}
case pMoneyx:
{
mysql_format(g_Sql, query1, sizeof(query1), "UPDATE `users` SET `Money` = '%d' WHERE `Name` = '%s'", PlayerInfo[playerid][pMoney], PlayerInfo[playerid][pName]);
mysql_tquery(g_Sql, query1, "", "");
}
}
}
}
return 1;
}
![Sad](images/smilies/sad.gif)