07.12.2010, 20:11
I'm not sure it works. However, try it... it looks to me.
First, put this ontop of your GM.
Now, you can put this under forward LoadPickUps();
And now go to your scriptfiles, open a new text tile with the name pickups.txt
after that put this function where ever you want on your GM
after you did all this, go to your OnGameModeInit()
and put under it this:
then under it:
now, go to your text file (pickups.txt)
and it works like that
1241, 2, 1503.3359, 1432.3585, 10.1191, -1
1242, 1, 1503.3359, 1432.3585, 10.1191, 0
1245, 3, 1503.3359, 1432.3585, 10.1191, 0
each one is pickup, you need to modify each one them,
Not tested, I guess it needs to work...
it looks good to me, test it and tell me, for help talk to me
First, put this ontop of your GM.
pawn Код:
forward LoadPickUps();
pawn Код:
enum puInfo
{
puModel,
puType,
Float:puCoordX,
Float:puCoordY,
Float:puCoordZ,
puVirtualW,
};
new PickUpInfo[MAX_PLAYERS][puInfo];
after that put this function where ever you want on your GM
pawn Код:
public LoadPickUps()
{
new Coords[30][128];
new string[256];
new File: file = fopen("pickups.txt", io_read);
if(file)
{
new idx;
while (idx < sizeof(PickUpInfo))
{
fread(file, string);
split(string, Coords, ',');
PickUpInfo[idx][puModel] = floatstr(Coords[0]);
PickUpInfo[idx][puType] = floatstr(Coords[1]);
PickUpInfo[idx][puCoordX] = floatstr(Coords[2]);
PickUpInfo[idx][puCoordY] = floatstr(Coords[3]);
PickUpInfo[idx][puCoordZ] = floatstr(Coords[4]);
PickUpInfo[idx][puVirtualW] = floatstr(Coords[5]);
idx++;
}
fclose(file);
}
return 1;
}
and put under it this:
pawn Код:
LoadPickUps();
pawn Код:
for(new p = 0; p < sizeof(PickUpInfo); p++)
{
CreatePickup(PickUpInfo[p][puModel], PickUpInfo[p][puType], PickUpInfo[p][puCoordX], HouseInfo[p][puCoordY], HouseInfo[p][puCoordZ], PickUpInfo[p][puVirtualW]);
}
and it works like that
1241, 2, 1503.3359, 1432.3585, 10.1191, -1
1242, 1, 1503.3359, 1432.3585, 10.1191, 0
1245, 3, 1503.3359, 1432.3585, 10.1191, 0
each one is pickup, you need to modify each one them,
Not tested, I guess it needs to work...
it looks good to me, test it and tell me, for help talk to me