PDA

View Full Version : sendclientmessagetoall doesn't work


bogushas
10/01/2015, 11:52 PM
format(g_szBuffer, sizeof g_szBuffer,

"UPDATE `"MySQL_PLAYERS_TABLE"` SET \
\
`SubLeader` = '%i' \
\
WHERE pName = '%s'",
fChosen[playerid],
id);
mysql_query(g_szBuffer);

format(frakcija[fChosen[playerid]][fLeader], MAX_PLAYER_NAME+1, "%s", id);
format(zinute, sizeof(zinute), "{d8a9ff}•{ffffff} lyderiø vadovas {d8a9ff}%s{ffffff} paskyrë naujàjá „{d8a9ff}%s{ffffff}“ frakcijos sub-lyderá {d8a9ff}%s{ffffff} !", getPlayerName(playerid), frakcija[fChosen[playerid]][fName], id);
SendClientMessageToAll(-1, zinute);
updateFractionLabel(fChosen[playerid]);
saveFractions(fChosen[playerid]);

fAction[playerid] = -1;
fChosen[playerid] = -1;

I don't see the message in the server, the mysql part works perfectly.

bogushas
11/01/2015, 12:11 AM
Please help

bogushas
11/01/2015, 12:25 AM
new id[24];

if(sscanf(inputtext,"s[24]", id))
{
SendError(playerid, "laukelis nebuvo pilnai užpildytas !");
fAction[playerid] = 14;
format(zinute, sizeof(zinute), "Redaguojama „%s“ frakcija", frakcija[fChosen[playerid]][fName]);
format(g_szBuffer, sizeof(g_szBuffer), "{ffffff}Redaguojama „{d8a9ff}%s{ffffff}“ frakcija:\n \n {d8a9ff}•{ffffff} atliekamas veiksmas %s,\n {d8a9ff}•{ffffff} veiksmo informacija %s", frakcija[fChosen[playerid]][fName], getActionEdit(playerid), setActionInfo(playerid));
ShowPlayerDialog(playerid, 855, DIALOG_STYLE_LIST, zinute, g_szBuffer, "Keisti", "Atgal");
return 1;
}
if(!strcmp(getPlayerName(playerid), id, false))
{
SendError(playerid, "savęs lyderiu nustatyti negalite !");
fAction[playerid] = 14;
format(zinute, sizeof(zinute), "Redaguojama „%s“ frakcija", frakcija[fChosen[playerid]][fName]);
format(g_szBuffer, sizeof(g_szBuffer), "{ffffff}Redaguojama „{d8a9ff}%s{ffffff}“ frakcija:\n \n {d8a9ff}•{ffffff} atliekamas veiksmas %s,\n {d8a9ff}•{ffffff} veiksmo informacija %s", frakcija[fChosen[playerid]][fName], getActionEdit(playerid), setActionInfo(playerid));
ShowPlayerDialog(playerid, 855, DIALOG_STYLE_LIST, zinute, g_szBuffer, "Keisti", "Atgal");
return 1;
}

format(g_szBuffer, sizeof(g_szBuffer), "SELECT `pName` FROM `"MySQL_PLAYERS_TABLE"` WHERE pName = '%s' LIMIT 1", id);
mysql_query(g_szBuffer);
mysql_store_result();
if(mysql_num_rows() == 1)
{
format(g_szBuffer, sizeof(g_szBuffer), "SELECT `SubLeader` FROM `"MySQL_PLAYERS_TABLE"` WHERE pName = '%s' LIMIT 1", id);
mysql_query(g_szBuffer);
mysql_store_result();

new Leading = mysql_fetch_int();

if(Leading > 0)
{
SendError(playerid, "žaidėjas jau vadovauja frakcijai !");
fChosen[playerid] = -1;
fAction[playerid] = -1;
}
else
{
format(g_szBuffer, sizeof g_szBuffer,

"UPDATE `"MySQL_PLAYERS_TABLE"` SET \
\
`SubLeader` = '%i' \
\
WHERE pName = '%s'",
fChosen[playerid],
id);
mysql_query(g_szBuffer);

format(frakcija[fChosen[playerid]][fLeader], MAX_PLAYER_NAME+1, "%s", id);
format(zinute, sizeof(zinute), "{d8a9ff}•{ffffff} lyderių vadovas {d8a9ff}%s{ffffff} paskyrė naująjį „{d8a9ff}%s{ffffff}“ frakcijos sub-lyderį {d8a9ff}%s{ffffff} !", getPlayerName(playerid), frakcija[fChosen[playerid]][fName], id);
SendClientMessageToAll(-1, zinute);
updateFractionLabel(fChosen[playerid]);
saveFractions(fChosen[playerid]);

fAction[playerid] = -1;
fChosen[playerid] = -1;
return 1;
}
mysql_free_result();
}
else
{
SendError(playerid, "duomenų bazėje toks žaidėjas neegzistuoja !");

fAction[playerid] = 15;
format(zinute, sizeof(zinute), "Redaguojama „%s“ frakcija", frakcija[fChosen[playerid]][fName]);
format(g_szBuffer, sizeof(g_szBuffer), "{ffffff}Redaguojama „{d8a9ff}%s{ffffff}“ frakcija:\n \n {d8a9ff}•{ffffff} atliekamas veiksmas %s,\n {d8a9ff}•{ffffff} veiksmo informacija %s", frakcija[fChosen[playerid]][fName], getActionEdit(playerid), setActionInfo(playerid));
ShowPlayerDialog(playerid, 855, DIALOG_STYLE_MSGBOX, zinute, g_szBuffer, "Keisti", "Atgal");
}