SA-MP Forums Archive
load agle and vehicle id in scriptfiles !!!! - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: load agle and vehicle id in scriptfiles !!!! (/showthread.php?tid=71329)



load agle and vehicle id in scriptfiles !!!! - OKeY - 31.03.2009

hi

here is the code that help make my:

Код:
 		fread(gfile, string), A = floatstr(string[2]);
		GetPlayerFacingAngle(playerid,A);
		fread(gfile, string), X = floatstr(string[2]);
		fread(gfile, string), Y = floatstr(string[2]);
		fread(gfile, string), Z = floatstr(string[2]);
		return SetPlayerPos(playerid, X, Y, Z);
and please help me add the angle of the vehicle and also to load the vehicle id


ps: and use PutPlayerInVehicle

MODIF:
can you help me chere a model car and teleport to the car ?? :P

thank





Re: load agle and vehicle id in scriptfiles !!!! - OKeY - 31.03.2009

sry but I made a modification


Re: load agle and vehicle id in scriptfiles !!!! - Nero_3D - 31.03.2009

pawn Код:
new Float:Pos[4], i, count = 3, lastvid;
    while(fread(gfile, string))
        for(i = strlen(string); i >= 0; i--)
        {
            if(i == 0)
            {
                if(count != -1) break;
                lastvid = CreateVehicle(strval(string), Pos[0], Pos[1], Pos[2], Pos[3], -1, -1, -1);
            }
            else if(string[i] == ',')
            {
                Pos[count--] = floatstr(string);
                string[i] = EOS;
            }
        }
    PutPlayerInVehicle(playerid, lastvid, 0);
    return true;
Not tested


the file just looks so
Код:
522, 333.3, 333.3, 333.3, 180.0



Re: load agle and vehicle id in scriptfiles !!!! - OKeY - 31.03.2009

slut I made my own code but when I order I made the server crash
Код:
 		fread(gfile, string), A = floatstr(string[2]);
		fread(gfile, string), X = floatstr(string[2]);
		fread(gfile, string), Y = floatstr(string[2]);
		fread(gfile, string), Z = floatstr(string[2]);
		fread(gfile, string), model = strval(string[2]);
		SetPlayerPos(playerid, X, Y, Z);
		GetPlayerFacingAngle(playerid,A);
		carmdl = CreateVehicle(model,X,Y,Z,A,6,6,50000);
		PutPlayerInVehicle(playerid, carmdl, 0);
		spawnveh = 1;
/ hause
and crash


Re: load agle and vehicle id in scriptfiles !!!! - Nero_3D - 31.03.2009

do it so
pawn Код:
fread(gfile, string), model = strval(string[6]);
        fread(gfile, string), X = floatstr(string[2]);
        fread(gfile, string), Y = floatstr(string[2]);
        fread(gfile, string), Z = floatstr(string[2]);
        fread(gfile, string), A = floatstr(string[2]);
        carmdl = CreateVehicle(model,X,Y,Z,A,6,6,50000);
        PutPlayerInVehicle(playerid, carmdl, 0);
        spawnveh = 1;
the file must look so
Код:
model=522
X=333.3
Y=333.3
Z=333.3
A=333.3



Re: load agle and vehicle id in scriptfiles !!!! - OKeY - 31.03.2009

Код:
A=8911,26
X=2466.2878
Y=-1659.0990
Z=12.8300
model=522