C++ to pawn
#1

Hello guys need help by converting c++ into pawn i write a little script witch just tells what do i want to do in pawn
Код:
#include <iostream>
#include <fstream>
#include <string>
using namespace std;

const string src = "scriptfile/enterexit/ex.txt";
const int amax = 100;

struct EnterExit{
    int id;
    int type;
    float x;
    float y;
    float z;
    float dx;
    float dy;
    float dz;
    float angle;
};

void fileRead(const string fn,EnterExit v[]);

int main()
{
    EnterExit v[amax];
    fileRead(src,v);
    return 0;
}

void fileRead(const string fn,EnterExit v[]){
    int a = 0;
    ifstream fin(fn.c_str());
    while(!fin.eof()){
        fin >> v[a].id >> v[a].type >> v[a].x >> v[a].y >> v[a].z >> v[a].dx >> v[a].dy >> v[a].dz >> v[a].angle;
        a++;
    }
    fin.close();
}
so this is just a basic code to read pickup cordinates id ant type from txt file and store them into array witch i will use later to create a enterexits pickups , the hardest part for me to do this into pawn is a file reading
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)