Difficulty in retrieving string from enum variables.
#1

I'm having trouble displaying the string that is in the variable listed in dialogs, could anyone help me to correct this code?

PHP код:
enum pInfoRotas {
    
fornecedor[25], //this one
    
loc1[25], //this one
    
Float:loc1x,
    
Float:loc1y,
    
Float:loc1z,
    
loc2[25], //this one
    
Float:loc2x,
    
Float:loc2y,
    
Float:loc2z,
    
tempo,
    
carga[25], //this one
    
valor
}
new 
PlayerInfoRotas[MAX_PLAYERS][pInfoRotas]; 
PHP код:
forward AplicandoCargas(playerid);
public 
AplicandoCargas(playerid) {
    
cache_get_field_content(0"fornecedor"PlayerInfoRotas[playerid][fornecedor]);
    
cache_get_field_content(0"loc1"PlayerInfoRotas[playerid][loc1]);
    
PlayerInfoRotas[playerid][loc1x] = cache_get_field_content_float(0"loc1x");
    
PlayerInfoRotas[playerid][loc1y] = cache_get_field_content_float(0"loc1y");
    
PlayerInfoRotas[playerid][loc1z] = cache_get_field_content_float(0"loc1z");
    
cache_get_field_content(0"loc2"PlayerInfoRotas[playerid][loc2]);
    
PlayerInfoRotas[playerid][loc2x] = cache_get_field_content_float(0"loc2x");
    
PlayerInfoRotas[playerid][loc2y] = cache_get_field_content_float(0"loc2y");
    
PlayerInfoRotas[playerid][loc2z] = cache_get_field_content_float(0"loc2z");
    
PlayerInfoRotas[playerid][tempo] = cache_get_field_content_int(0"tempo");
    
cache_get_field_content(0"carga"PlayerInfoRotas[playerid][carga]);
    
PlayerInfoRotas[playerid][valor] = cache_get_field_content_int(0"valor");
    return 
1;

PHP код:
CMD:trabalhar(playerid) {
    if(
Trabalhando[playerid] != 0) return SendClientMessage(playerid, -1"Vocк jб estб Trabalhando!");
    if(
Emprego[playerid] == Caminhoneiro) {
        new 
vehicleid GetPlayerVehicleID(playerid);
        if(
GetVehicleModel(vehicleid) == 455) {
            new 
query[120];
            
mysql_format(MySqlCquerysizeof(query), "SELECT * FROM `cargasflatbad` WHERE `id` = '1'");
            
mysql_tquery(MySqlCquery"AplicandoCargas""i"playerid);
            new 
string[120];
            
format(stringsizeof(string), "De: %s - Para: %s"PlayerInfoRotas[25][loc1], PlayerInfoRotas[54][loc2]); //this one
            
ShowPlayerDialog(playeridDIALOG01DIALOG_STYLE_LIST"Rotas Testy"string"Aceitar""Recusar"); //this one
        
}
    }
    return 
1;

Reply
#2

https://sampwiki.blast.hk/wiki/MySQL/R33..._field_content

From what I can see, here's your issue:

Reply
#3

Quote:
Originally Posted by Dignity
Посмотреть сообщение
https://sampwiki.blast.hk/wiki/MySQL/R33..._field_content

From what I can see, here's your issue:

---

Like this?

PHP код:
cache_get_field_content(0"fornecedor"PlayerInfoRotas[playerid][fornecedor], 25);
cache_get_field_content(0"loc1"PlayerInfoRotas[playerid][loc1], 25);
cache_get_field_content(0"loc2"PlayerInfoRotas[playerid][loc2], 25);
cache_get_field_content(0"carga"PlayerInfoRotas[playerid][carga], 25); 
Because don't work: http://prnt.sc/dfeg7u
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)