20.10.2012, 03:55
Am I doing this right, and could someone give me some advice as to what I could be doing better? I'm brand new to using MySQL in PAWN, so I'm having a pretty hard time adjusting.
From what I can understand, this query thing basically works like SetTimerEx, you pass the parameters then your callback picks them up and you do the rest of your things in there.. If someone could explain it in lamens terms, that'd be like.. perfect.
pawn Код:
new
connectionHandle;
public OnGameModeInit()
{
mysql_debug( true );
connectionHandle = mysql_connect("localhost", "sky", "samp", "lol");
mysql_function_query( connectionHandle, "SELECT * FROM `mine`", true, "OnPlayerSelected", "");
SetGameModeText("Anarchy");
AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
return 1;
}
forward OnPlayerSelected( );
public OnPlayerSelected( )
{
mysql_function_query( connectionHandle, "UPDATE `mine` SET `lol` = 1 WHERE `lol` = 16", false, "", "" );
return true;
}