10.01.2016, 14:50
i trying make change chatstyle cmd but when i change chatstyle wont update it in my mysql database what might be the problme?
PHP код:
}
CMD:chatstyle(playerid, params[])
{
new aimid, szQuery[128];
if(sscanf(params, "i", aimid)) SendClientMessage(playerid, COLOR_GREY, "USAGE: /chatstyle [0-8]");
else
{
if (PlayerCuffed[playerid] >= 1) return SendClientMessageEx(playerid, COLOR_WHITE, "You cannot use this while cuffed!");
if (PlayerInfo[playerid][pJailTime] > 0) return SendClientMessageEx(playerid, COLOR_WHITE, "You cannot use this now!");
if (PlayerInfo[playerid][pHospital] > 0) return SendClientMessageEx(playerid, COLOR_WHITE, "You cannot use this while in hospital");
if (GetPVarInt(playerid, "Injured")) return SendClientMessageEx(playerid, COLOR_WHITE, "You cannot use this while dead!");
switch(aimid)
{
case 0:
{
DeletePVar(playerid,"ChatStyle");
SendClientMessage(playerid,COLOR_WHITE,"Chatstyle removed.");
}
case 1 .. 8:
{
format(szQuery, sizeof(szQuery), "UPDATE `accounts` SET `ChatStyle`=%d WHERE `ChatStyle` = '%d'", PlayerInfo[aimid][pChatStyle]);
mysql_function_query(MainPipeline, szQuery, false, "OnQueryFinish", "ii", SENDDATA_THREAD, playerid);
SetPVarInt(playerid, "ChatStyle", aimid);
SendClientMessage(playerid,COLOR_WHITE,"Chatstyle set.");
}
default: SendClientMessage(playerid, COLOR_GREY, "USAGE: /chatstyle [0-8]");
}
}
return 1;
}