Habe hier nochmal mein kleines FS was ich noch anpassen muss
// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT
#include <a_samp>
#if defined filterscript
int i = 0;
void swap (int x, int y) {
int temp;
temp = x;
x = y;
y = temp;
}
int f() {
i++;
return i;
}
main()
{
for(int i = 0; i < x; i++)
{
int feld[4] = {4,3,2,1};
int zahl1=5, zahl2=3;
printf("vor swap: zahl1=%d, zahl2=%d\n", zahl1, zahl2);
swap(zahl1, zahl2);
printf("nach swap: zahl1=%d, zahl2=%d\n", zahl1, zahl2);
printf ("feld-Inhalt vor swap: {%d, %d, %d, %d}\n", feld[0], feld[1],feld[2], feld[3]);
swap (&i, &feld[f()]);
printf ("feld-Inhalt nach swap:{%d, %d, %d, %d}\n", feld[0], feld[1],feld[2], feld[3]);
return 0;
}
}
}
#endif
Alles anzeigen
Mir ist 1. aufgefallen:
Warum finden voids in PAWN bzw. in SA-MP Scripts nie Verwendung? Sind doch super praktisch.
Warum wird der Iterator in der for Schleife in SAMP Scripts immer mit "new" erstellt, und nicht wie bei mir mit for(int bla bla ) statt for(new zahl) ?