String always displays faction ID 1
#1

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:
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], idFloat:factionXFloat:factionYFloat:factionZDB_Query[1000], query[1000];
          if(
sscanf(params"d"id)) return SendClientMessage(playeridCOLOR_GRAYTEXT"SERVER:{FFFFFF} /changefacpos [factionID]");
        {
            
factionInfo[fID][fID] = id;
            
mysql_format(DatabaseDB_Querysizeof(DB_Query), "SELECT * FROM `factions` WHERE `fID` = '%d'"id);
            
mysql_tquery(DatabaseDB_Query);
            
//cache_get_row_count(rows);
            //if(factionInfo[fID][fID] == true)
            
{
                
GetPlayerPos(playeridfactionXfactionYfactionZ);
                {
                 
DestroyDynamicPickup(factionInfo[fID][fID]);
                    {
                        
factionInfo[fID][facX] = factionX;
                        
factionInfo[fID][facY] = factionY;
                        
factionInfo[fID][facZ] = factionZ;
                        
format(stringsizeof(string), "{SERVER}: {FFFFFF}You have just edited faction ID: %d's info position. (%f, %f, %f) (%s)"idfactionXfactionYfactionZ,factionInfo[fID][facName]);
                        
SendClientMessage(playeridCOLOR_GRAYTEXTstring);
                        
format(querysizeof(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(Databasequery);
                           {
                            
factionInfo[fID][fID] = CreateDynamicPickup(12391factionXfactionYfactionZ00);
                           }
                       }
                }
            }
            
/*else
            {
                SendClientMessage(playerid, -1, "Faction doesnt exist");
            }*/
        
}
    }
    return 
1;

Reply
#2

try
Код:
format(string, sizeof(string), "{SERVER}: {FFFFFF}You have just edited faction ID: %d's info position. (%f, %f, %f) (%s)", factionInfo[fID][fID], factionX, factionY, factionZ,factionInfo[fID][facName]);
Reply
#3

Quote:
Originally Posted by reddoxx
Посмотреть сообщение
try
Код:
format(string, sizeof(string), "{SERVER}: {FFFFFF}You have just edited faction ID: %d's info position. (%f, %f, %f) (%s)", factionInfo[fID][fID], factionX, factionY, factionZ,factionInfo[fID][facName]);
Tried that, this is displayed in game:

PHP код:
[19:22:10] {SERVER}: {FFFFFF}You have just edited faction ID1's info position. (140.718002, -72.125198, 1.429687) (CSPD)
[19:22:13] {SERVER}: {FFFFFF}You have just edited faction ID: 2'
s info position. (134.421081, -71.9208061.429687) (CSPD
Yes, it selects the correct faction ID and updates it successfully. Have tested with print(DB_Query);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)