stock LoadStats(playerid) { new pName[24],Query[80]; GetPlayerName(playerid,pName,24); format(Query,sizeof(Query), "SELECT * FROM `Users` WHERE `Username` = '%s';", pName); mysql_query(Query); mysql_store_result(); mysql_fetch_row_format(Query, "|"); sscanf(Query, "e<p<|>s[24]s[23]ddddfffdddd>", PInfo[playerid]); mysql_free_result(); GivePlayerMoney(playerid,PInfo[playerid][Money]); SetSpawnInfo(playerid, 0, PInfo[playerid][SkinID], PInfo[playerid][PosX], PInfo[playerid][PosY], PInfo[playerid][PosZ], 10, 0,0,0,0,0,0); SpawnPlayer(playerid); SetPlayerScore(playerid, PInfo[playerid][Level]); SetPlayerSkin(playerid, PInfo[playerid][SkinID]); return 1; }
stock LoadStats(playerid)
{
new pName[24],Query[80];
GetPlayerName(playerid,pName,24);
format(Query,sizeof(Query), "SELECT * FROM `Users` WHERE `Username` = '%s';", pName);
mysql_query(Query);
mysql_store_result();
mysql_fetch_row_format(Query, "|");
sscanf(Query, "e<p<|>s[24]s[23]ddddfffdddd>", PInfo[playerid]);
mysql_free_result();
GivePlayerMoney(playerid,PInfo[playerid][Money]);
SetSpawnInfo(playerid, 0, PInfo[playerid][SkinID], PInfo[playerid][PosX], PInfo[playerid][PosY], PInfo[playerid][PosZ], 10, 0,0,0,0,0,0);
SpawnPlayer(playerid);
SetPlayerScore(playerid, PInfo[playerid][Level]);
return 1;
}
pawn Код:
|
public OnGameModeInit()
{
mysql_connect(mysql_host,mysql_user,mysql_database,mysql_password);
mysql_debug(1);
SetGameModeText("UK-RP v1.00 (June 09");
ShowPlayerMarkers(0);
ShowNameTags(1);
AddPlayerClass(1,0,0,0,0,0,0,0,0,0,0);
AddPlayerClass(2,0,0,0,0,0,0,0,0,0,0);
AddPlayerClass(3,0,0,0,0,0,0,0,0,0,0);
AddPlayerClass(4,0,0,0,0,0,0,0,0,0,0);
AddPlayerClass(5,0,0,0,0,0,0,0,0,0,0);
AddPlayerClass(6,0,0,0,0,0,0,0,0,0,0);
AddPlayerClass(7,0,0,0,0,0,0,0,0,0,0);
AddPlayerClass(8,0,0,0,0,0,0,0,0,0,0);
AddPlayerClass(9,0,0,0,0,0,0,0,0,0,0);
AddPlayerClass(10,0,0,0,0,0,0,0,0,0,0);
AddPlayerClass(11,0,0,0,0,0,0,0,0,0,0);
AddPlayerClass(12,0,0,0,0,0,0,0,0,0,0);
AddPlayerClass(13,0,0,0,0,0,0,0,0,0,0);
AddPlayerClass(14,0,0,0,0,0,0,0,0,0,0);
AddPlayerClass(15,0,0,0,0,0,0,0,0,0,0);
AddPlayerClass(16,0,0,0,0,0,0,0,0,0,0);
AddPlayerClass(17,0,0,0,0,0,0,0,0,0,0);
AddPlayerClass(18,0,0,0,0,0,0,0,0,0,0);
AddPlayerClass(19,0,0,0,0,0,0,0,0,0,0);
AddPlayerClass(20,0,0,0,0,0,0,0,0,0,0);
AddPlayerClass(21,0,0,0,0,0,0,0,0,0,0);
AddPlayerClass(22,0,0,0,0,0,0,0,0,0,0);
AddPlayerClass(23,0,0,0,0,0,0,0,0,0,0);
AddPlayerClass(24,0,0,0,0,0,0,0,0,0,0);
AddPlayerClass(25,0,0,0,0,0,0,0,0,0,0);
AddPlayerClass(26,0,0,0,0,0,0,0,0,0,0);
AddPlayerClass(27,0,0,0,0,0,0,0,0,0,0);
AddPlayerClass(28,0,0,0,0,0,0,0,0,0,0);
AddPlayerClass(29,0,0,0,0,0,0,0,0,0,0);
AddPlayerClass(30,0,0,0,0,0,0,0,0,0,0);
AddPlayerClass(31,0,0,0,0,0,0,0,0,0,0);
AddPlayerClass(178,0,0,0,0,0,0,0,0,0,0);
AddPlayerClass(230,0,0,0,0,0,0,0,0,0,0);
return 1;
}