SA-MP Forums

Go Back   SA-MP Forums > Non-English > Languages > Português/Portuguese

Reply
 
Thread Tools Display Modes
Old 13/06/2018, 11:07 PM   #11
AutoMatic2
Big Clucker
 
Join Date: Apr 2018
Posts: 113
Reputation: 2
Default Re: string

Vc ta colocando esse codigo na OnGameModeInit?
AutoMatic2 is offline   Reply With Quote
Old 13/06/2018, 11:10 PM   #12
AutoMatic2
Big Clucker
 
Join Date: Apr 2018
Posts: 113
Reputation: 2
Default Re: string

PHP Code:
public OnGameModeInit()
{
    new 
query250 ], PickupId;

    for(new 
0MAX_CASASc++)
    {
        
format(querysizeof(query), "Casas/Casa%d.ini"c);

        if(
DOF2_FileExists(query))
        {
            if(
DOF2_GetInt(query"TDono") == 0)
            {
                
houseData[c][houseX] = DOF2_GetFloat(query"PosX");
                
houseData[c][houseY] = DOF2_GetFloat(query"PosY");
                
houseData[c][houseZ] = DOF2_GetFloat(query"PosZ");
                
houseData[c][Dono] = DOF2_GetString(query"Dono");
                
houseData[c][PrecoH] = DOF2_GetInt(query"Preco");
                
houseData[c][CasaID] = DOF2_GetInt(query"CasaId");

                
PickupId CreateDynamicPickup(12731houseData[c][houseX], houseData[c][houseY], houseData[c][houseZ], -1, -1, -13.0);
                
DOF2_SetInt(query"PickupId"PickupId);

                
format(STRXsizeof(STRX), "{00FFFF}CasaID: {FFFFFF}%d\n\n{00FFFF}Dono(a): {FFFFFF}Ninguem"c);
                
LabelCasa[c] = CreateDynamic3DTextLabel(STRX, -1houseData[c][houseX], houseData[c][houseY], houseData[c][houseZ], 30.0INVALID_PLAYER_IDINVALID_VEHICLE_ID1, -1, -1, -13.0);

                
ProximaCasa++;
            }
            else
            {
                
houseData[c][houseX] = DOF2_GetFloat(query"PosX");
                
houseData[c][houseY] = DOF2_GetFloat(query"PosY");
                
houseData[c][houseZ] = DOF2_GetFloat(query"PosZ");
                
houseData[c][Dono] = DOF2_GetString(query"Dono");
                
houseData[c][PrecoH] = DOF2_GetInt(query"Preco");
                
houseData[c][CasaID] = DOF2_GetInt(query"CasaId");

                
PickupId CreateDynamicPickup(195221houseData[c][houseX], houseData[c][houseY], houseData[c][houseZ], -1, -1, -13.0);
                
DOF2_SetInt(query"PickupId"PickupId);

                
format(STRXsizeof(STRX), "{00FFFF}CasaID: {FFFFFF}%d\n\n{00FFFF}Dono(a): {FFFFFF}%s"chouseData[c][Dono]);
                
LabelCasa[c] = CreateDynamic3DTextLabel(STRX, -1houseData[c][houseX], houseData[c][houseY], houseData[c][houseZ], 30.0INVALID_PLAYER_IDINVALID_VEHICLE_ID1, -1, -1, -13.0);

                
ProximaCasa++;
            }
        }
    }
    return 
1;

Peguei uma base aqui e fiz com suas variavel
AutoMatic2 is offline   Reply With Quote
Old 13/06/2018, 11:39 PM   #13
iWiNeR
Big Clucker
 
Join Date: Dec 2014
Location: Brasil
Posts: 129
Reputation: 0
Default Re: string

Quote:
Originally Posted by AutoMatic2 View Post
Vc ta colocando esse codigo na OnGameModeInit?
Não, a parte de carregar as casas está okay, oq está acontecendo é quando alguém usa /comprarcasa em vez de atualizar o 3DTextLabel ele cria outro e fica sobreposto um escrito Ninguem e outro com o Dono da casa
__________________
Code:
   Space RP
iWiNeR is offline   Reply With Quote
Old 14/06/2018, 12:00 AM   #14
AutoMatic2
Big Clucker
 
Join Date: Apr 2018
Posts: 113
Reputation: 2
Wink Re: string

'-'

o trem ta CarregarCasa ue :/

usa o UpdateDynamic3DTextLabelText

Talvez manda seu comando /ComprarCasa
AutoMatic2 is offline   Reply With Quote
Old 14/06/2018, 01:33 AM   #15
iWiNeR
Big Clucker
 
Join Date: Dec 2014
Location: Brasil
Posts: 129
Reputation: 0
Default Re: string

Quote:
Originally Posted by AutoMatic2 View Post
'-'

o trem ta CarregarCasa ue :/

usa o UpdateDynamic3DTextLabelText

Talvez manda seu comando /ComprarCasa
Aqui

PHP Code:
if(houseData[id][PrecoH] > GetPlayerMoney(playerid)) return SendClientMessage(playerid, -1"[ERRO] Você não tem esse dinheiro ");
            {
                new 
query[250];
                new 
hName[64];
                
GivePlayerMoney(playerid, -houseData[id][PrecoH]);
                
SendClientMessage(playerid, -1"[SERVER] Você comprou uma casa, para mais informações utilize /ajuda casa");
                
format(hNamesizeof(hName), "%s",GetName(playerid));
                
format(querysizeof(query), "Casas/Casa%d.ini"id);
                
DOF2_SetString(query"Dono"hName);
                
DOF2_SaveFile();
                
format(houseData[id][Dono], 24DOF2_GetString(query"Dono"));
                
format(STRXsizeof(STRX), "{00FFFF}Dono(a): {FFFFFF}%s \n\n{00FFFF}CasaID:{FFFFFF}%d"houseData[id][Dono],id);
                
UpdateDynamic3DTextLabelText(CasaTLabel[id], -1STRX);
            } 
__________________
Code:
   Space RP
iWiNeR is offline   Reply With Quote
Old 14/06/2018, 02:27 AM   #16
AutoMatic2
Big Clucker
 
Join Date: Apr 2018
Posts: 113
Reputation: 2
Wink Re: string

Acho que vc ja testo assim
PHP Code:
new PnameMAX_PLAYER_NAME ];
GetPlayerName(playeridPnamesizeof(Pname));

if(
houseData[id][PrecoH] > GetPlayerMoney(playerid)) return SendClientMessage(playerid, -1"[ERRO] Você não tem esse dinheiro ");
{
    new 
query[250];
    new 
hName[64];
    
GivePlayerMoney(playerid, -houseData[id][PrecoH]);
    
SendClientMessage(playerid, -1"[SERVER] Você comprou uma casa, para mais informações utilize /ajuda casa");
    
format(querysizeof(query), "Casas/Casa%d.ini"id);
    
DOF2_SetInt(query"TDono"1);
    
DOF2_SetString(query"Dono"Pname);
    
DOF2_SaveFile();
    
format(STRXsizeof(STRX), "{00FFFF}Dono(a): {FFFFFF}%s \n\n{00FFFF}CasaID:{FFFFFF}%d"DOF2_GetString(query"Dono"), id);
    
UpdateDynamic3DTextLabelText(CasaTLabel[id], -1STRX);

E tbm o meu se usa DOF2_GetString(query, "Dono") e carrega sem poblema

e faz outra função que e o DOF2_SetInt(query, "TDono") essa função vai te ajudar
AutoMatic2 is offline   Reply With Quote
Old 14/06/2018, 02:50 AM   #17
iWiNeR
Big Clucker
 
Join Date: Dec 2014
Location: Brasil
Posts: 129
Reputation: 0
Default Re: string

Quote:
Originally Posted by AutoMatic2 View Post
Acho que vc ja testo assim
PHP Code:
new PnameMAX_PLAYER_NAME ];
GetPlayerName(playeridPnamesizeof(Pname));

if(
houseData[id][PrecoH] > GetPlayerMoney(playerid)) return SendClientMessage(playerid, -1"[ERRO] Você não tem esse dinheiro ");
{
    new 
query[250];
    new 
hName[64];
    
GivePlayerMoney(playerid, -houseData[id][PrecoH]);
    
SendClientMessage(playerid, -1"[SERVER] Você comprou uma casa, para mais informações utilize /ajuda casa");
    
format(querysizeof(query), "Casas/Casa%d.ini"id);
    
DOF2_SetInt(query"TDono"1);
    
DOF2_SetString(query"Dono"Pname);
    
DOF2_SaveFile();
    
format(STRXsizeof(STRX), "{00FFFF}Dono(a): {FFFFFF}%s \n\n{00FFFF}CasaID:{FFFFFF}%d"DOF2_GetString(query"Dono"), id);
    
UpdateDynamic3DTextLabelText(CasaTLabel[id], -1STRX);

E tbm o meu se usa DOF2_GetString(query, "Dono") e carrega sem poblema

e faz outra função que e o DOF2_SetInt(query, "TDono") essa função vai te ajudar
Ja testei dessa forma, quando eu reinicio o server ele carrega normal o 3DTextLabel, o problema é que ele fica sobreposto quando usa o /comprarcasa como se em vez de atualizar ele criasse outro
__________________
Code:
   Space RP
iWiNeR is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
input line too long (after substitutions) invalid string (possibly non-terminated string) StackedPizza Scripting Help 4 09/11/2016 02:34 AM
error 037: invalid string (possibly non-terminated string) Patrick Scripting Help 9 06/03/2013 05:53 PM
string too small. but i dont wanna make the string like 9999.. niels44 Scripting Help 3 23/10/2012 05:36 PM
input line too long (after substitutions) - invalid string (possibly non-terminated string) MahmutBey Help Archive 7 10/03/2011 02:02 PM


All times are GMT. The time now is 09:12 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.