12.11.2015, 12:28
i did not test it with this [easy-mysql] but i think it must work,
PHP код:
native gpci (playerid, serial [], len); /// at top
enum sbAdmin
{
pGPCI[128]
};
new User[MAX_PLAYERS][sbAdmin];
stock GetPlayerGPCI(playerid)
{
new GPCI[128];
gpci(playerid, GPCI, 128);
return GPCI;
}
CMD:gpciscan(playerid,params[])
{
new target;
if(sscanf(params, "u", target)) return SendClientMessage(playerid,"/GPCIScan [ID]");
if(target == INVALID_PLAYER_ID) return SendClientMessage(playerid,"Invalid Player id");
if(SQL::RowExistsEx(""PLAYERS_TABLE"", "username", GetName(target)))
{
new handle = SQL::OpenEx(SQL::READ, ""PLAYERS_TABLE"", "username", GetName(target));
SQL::ReadString(handle, "GPCI", User[target][pGPCI], 128);
SQL::Close(handle);
}
new string[250];
format(string,sizeof(string), "%s's GPCI - %s", GetName(target), User[target][pGPCI]);
SendClientMessage(playerid,-1,string);
return 1;
}
// SQL::WriteString(handle, "GPCI", GetPlayerGPCI(playerid)); //write it