01.12.2012, 11:17
pawn Код:
new Query[256];
format(Query, sizeof(Query), "SELECT `username` FROM `players` WHERE username = '%s' AND FMember = %d LIMIT %d", inputtext, PlayerInfo[playerid][pFMember], MAX_FAMILIES);
mysql_function_query(g_Handle, Query, true, "OnFamilyFire", "s[100]i", inputtext, playerid);
pawn Код:
forward OnFamilyFire(name[], playerid);
public OnFamilyFire(name[], playerid)
{
new Query[200];
new rows, fields;
cache_get_data(rows, fields);
if(!rows)
{
ShowPlayerDialog(playerid, 999, DIALOG_STYLE_MSGBOX, "{00BC00}Meniul {F6F6F6}Familiei", "{00BC00}EROARE! {F6F6F6}Acel jucator nu este in familia ta sau nici nu exista!", "OK", "");
}
else
{
format(Query, sizeof(Query), "UPDATE `players` SET `FMember` = 255 WHERE username = '%s'", name);
mysql_function_query(g_Handle, Query, false, "SendQuery", "");
ShowPlayerDialog(playerid, 999, DIALOG_STYLE_MSGBOX, "{00BC00}Meniul {F6F6F6}Familiei", "{00BC00}Succes! {F6F6F6}Acel jucator a fost dat afara!", "OK", "");
}
return 1;
}
pawn Код:
mysql_function_query(g_Handle, Query, true, "OnFamilyFire", "s[100]i", inputtext, playerid);