27.09.2018, 18:09
Hi. I have a command that changes teh faction positions and is scripted to send the client a message with the ID and the position of the faction. It changes the faction position and changes the ID properly but displays the faction as always being as ID 1
(under the faction name it looks like this:
)
This affects my textdraw script and displays faction ID 1's name when the faction has recently changed position
/changefacpos :
(under the faction name it looks like this:
PHP код:
{SERVER}: {FFFFFF}You have just edited faction ID: %d's info position. (X, Y, Z) (CSPD)
This affects my textdraw script and displays faction ID 1's name when the faction has recently changed position
/changefacpos :
PHP код:
CMD:changefacpos(playerid,params[])
{
// if(playerInfo[playerid][playerAdmin] >= 5)
{
new string[128], id, Float:factionX, Float:factionY, Float:factionZ, DB_Query[1000], query[1000];
if(sscanf(params, "d", id)) return SendClientMessage(playerid, COLOR_GRAYTEXT, "SERVER:{FFFFFF} /changefacpos [factionID]");
{
factionInfo[fID][fID] = id;
mysql_format(Database, DB_Query, sizeof(DB_Query), "SELECT * FROM `factions` WHERE `fID` = '%d'", id);
mysql_tquery(Database, DB_Query);
//cache_get_row_count(rows);
//if(factionInfo[fID][fID] == true)
{
GetPlayerPos(playerid, factionX, factionY, factionZ);
{
DestroyDynamicPickup(factionInfo[fID][fID]);
{
factionInfo[fID][facX] = factionX;
factionInfo[fID][facY] = factionY;
factionInfo[fID][facZ] = factionZ;
format(string, sizeof(string), "{SERVER}: {FFFFFF}You have just edited faction ID: %d's info position. (%f, %f, %f) (%s)", id, factionX, factionY, factionZ,factionInfo[fID][facName]);
SendClientMessage(playerid, COLOR_GRAYTEXT, string);
format(query, sizeof(query), "UPDATE `factions` SET `facX` = '%f', `facY` = '%f', `facZ` = '%f' WHERE `fID` = '%d'", factionInfo[fID][facX],factionInfo[fID][facY],factionInfo[fID][facZ],factionInfo[fID][fID]);
mysql_tquery(Database, query);
{
factionInfo[fID][fID] = CreateDynamicPickup(1239, 1, factionX, factionY, factionZ, 0, 0);
}
}
}
}
/*else
{
SendClientMessage(playerid, -1, "Faction doesnt exist");
}*/
}
}
return 1;
}