Hi All,
A short time ago I started to make a public function, but I still don't really get it.
I now have this:
And what I think is, that I did it totally wrong!
What he needs to do is, if I do in a command in OnPlayerCommandText: set_mysql_loggedin_level(sendername, 0);
It needs to set/update the player level to 0. and if I insert 1 in the place of 0. It needs to be updated to 1. Don't look at the mysql-lines (format + 2 samp_mysql_), they are good.
I hope someone can help me!
A short time ago I started to make a public function, but I still don't really get it.
I now have this:
Code:
public set_mysql_loggedin_level(pname, level)
{
new giveplayerid[MAX_PLAYER_NAME];
new prname[16];
GetPlayerName(giveplayerid,prname,sizeof(prname));
format(strlogin, sizeof(strlogin), "UPDATE users SET loggedin='%d' WHERE name = '%s'", level,prname);
samp_mysql_query(strlogin);
samp_mysql_store_result();
}
And what I think is, that I did it totally wrong!
What he needs to do is, if I do in a command in OnPlayerCommandText: set_mysql_loggedin_level(sendername, 0);
It needs to set/update the player level to 0. and if I insert 1 in the place of 0. It needs to be updated to 1. Don't look at the mysql-lines (format + 2 samp_mysql_), they are good.
I hope someone can help me!