Jump to content
Geplaatst:
comment_1444115

Ik probeer text op the halrn uit een .txt maar het werkt niet,

Kan iemand mij hierbij helpen?

Ik heb het op meerdere maieren geprobeerd:

Manier 1:

new Zinnetje1[300];
new Zinnetje2[300];
format(Zinnetje1, 300, "%s", dini_Get("PropertySystem/Cars/car1.txt", "Model"));
format(Zinnetje2, 300, "%s", dini_Get("PropertySystem/Cars/car1.txt", "Owner"));
new string[128];
format(string, sizeof(string), "Model: %d Owner: %d",Zinnetje1,Zinnetje2);
SendClientMessage(playerid, LBLUE, string);

Manier 2:

new M[256];
new O[256];
M = dini_Get("PropertySystem/Cars/car1.txt", "Model");
O = dini_Get("PropertySystem/Cars/car1.txt", "Owner");
new string[128];
format(string, sizeof(string), "Model: %d Owner: %d",M,O);
SendClientMessage(playerid, LBLUE, string);

Ik blijf krijgen:

Model: 65 Owner 66

of

Model 65 Owner: 0

terwijl het nu moet zijn:

Model=Aap

Owner=Bjorn

Dus: Model: Aap Owner: Bjorn

Bewerkt: door mosweg

Featured Replies

Geplaatst:
comment_1444125
	new M[64];
new O[64];
strcat(M, dini_Get(fPropertySystem/Cars/car1.txt,"Model"));
strcat(O, dini_Get(fPropertySystem/Cars/car1.txt,"Owner"));
new string[128];
format(string, sizeof(string), "Model: %s Owner: %s",M,O);
SendClientMessage(playerid, LBLUE, string);

Bewerkt: door Remi-X

Geplaatst:
  • Auteur
comment_1444175

Bedankt, Dit kan ik nu ook gaan gebruiken voor andere dingen,

O ja, het was toevallig net ietsje anders:

new M[64];
new O[64];
strcat(M, dini_Get("PropertySystem/Cars/car1.txt","Model"));
strcat(O, dini_Get("PropertySystem/Cars/car1.txt","Owner"));
new string[128];
format(string, sizeof(string), "Model: %s Owner: %s",M,O);
SendClientMessage(playerid, LBLUE, string);

Geplaatst:
comment_1444839

Misschien kan dit dan nog wel eens van pas komen ;)

%b Inserts a number at this position in binary radix

%c Inserts a single character.

%d Inserts an integer (whole) number

%f Inserts a floating point number.

%i Inserts an integer.

%s Inserts a string.

%x Inserts a number in hexadecimal notation.

%% Inserts the literal '%'

Een reactie plaatsen

Je kan nu een reactie plaatsen en pas achteraf registreren. Als je al lid bent, log eerst in om met je eigen account een reactie te plaatsen.

Gast
Op dit onderwerp reageren...

Recent actief 0

  • Er zijn hier geen geregistreerde gebruikers aanwezig.