Help me with MySQL and Incognito Streamer please
#1

1. Challenge: write a function that prints the nick-name the player with the specified ID account.
On Russian-language forum thread we've come to this conclusion:
PHP код:
stock OfflineName( ID ) 
{ 
    new 
query[256], name[24]; 
    
format(query, sizeof(query), "SELECT `nick` FROM `players` WHERE `ID` = '%d'", ID); 
    new 
Cache:queryname = mysql_query(chandle, query); 
    if ( 
cache_num_rows() ) {
         
cache_get_field_content(0, "nick", name);
    }
    else {
         
format (name, 24, "None") ;
    }
    
cache_delete(queryname);
    return 
name; 
} 
But this function displays the nick-name player only when first using it:
https://www.dropbox.com/s/14hisz23cr...2019.20.34.png
https://www.dropbox.com/s/w9uiilr8bm...2019.19.57.png
PHP код:
if(HouseInfo[id][hOwner] == 0)
{
    
HouseInfo[id][hPickup] = CreatePickup(1273, 23, HouseInfo[id][hEnterX], HouseInfo[id][hEnterY], HouseInfo[id][hEnterZ], 0);
    
HouseInfo[id][hMapIcon] = CreateDynamicMapIcon(HouseInfo[id][hEnterX], HouseInfo[id][hEnterY], HouseInfo[id][hEnterZ], 31, 1);
    
format(string, sizeof(string), "Price: {FFFFFF}$%d", HouseInfo[id][hPrice]);
    
HouseInfo[id][hLabel] = CreateDynamic3DTextLabel(string, 0xFF7400FF, HouseInfo[id][hEnterX], HouseInfo[id][hEnterY], HouseInfo[id][hEnterZ], 20.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, -1, -1, -1, 20.0);
}
else
{
    
HouseInfo[id][hPickup] = CreatePickup(1314, 23, HouseInfo[id][hEnterX], HouseInfo[id][hEnterY], HouseInfo[id][hEnterZ], 0);
    
format(string, sizeof(string), "Owner: {FFFFFF}%s", OfflineName(HouseInfo[id][hOwner]));
    
HouseInfo[id][hLabel] = CreateDynamic3DTextLabel(string, 0xFF7400FF, HouseInfo[id][hEnterX], HouseInfo[id][hEnterY], HouseInfo[id][hEnterZ], 20.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, -1, -1, -1, 20.0);
} 
What's wrong?

2. Challenge: Attach 3D text on vehicle (Incognito Streamer).

PHP код:
new Float:P[4];
GetPlayerPos(playerid, P[0], P[1], P[2]);
GetPlayerFacingAngle(playerid, P[3]);
CarInfo[LastVehicle][CarServerID] = CreateVehicle(params[2], P[0], P[1], P[2], P[3], random(125), random(125), 360);
format(string, sizeof(string), "Model: {B6FF00}%s\n{FFFFFF}Price: {B6FF00}$%d", GetVehicleName[params[2]-400], params[1]);
CarInfo[LastVehicle][CarLabel] = CreateDynamic3DTextLabel(string, 0xFFFFFFFF, P[0], P[1], P[2], 25.0, INVALID_PLAYER_ID, CarInfo[LastVehicle][CarServerID], 0, -1, -1, -1, 25.0); 
The machine ID in the variable is written correctly, but the 3D text en is created. In what could be the problem?
https://www.dropbox.com/s/907axoi9wifhiq3/sa-mp-015.png

Sry for bad English.
Reply
#2

bump
Reply
#3

bump
Reply
#4

bump
Reply
#5

bump
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)