Jump to content
View in the app

A better way to browse. Learn more.

GTAGames.nl - De Nederlandse Grand Theft Auto Community!

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.
Posted

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

Edited by mosweg

Featured Replies

	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);

Edited by Remi-X

  • Author

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);

Jouw vorige manier kon ook hoor. Je hoeft alleen die 2 %d te vervangen met %s

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 '%'

  • Author

zeker weten,

Ik wist al dat ik met text %s moest gebruiken en met numbers %d maar de rest wist ik niet,

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

Recently Browsing 0

  • No registered users viewing this page.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.