23.07.2011, 10:01
(
Последний раз редактировалось Petru_Me; 23.07.2011 в 10:51.
)
Hi ! I want to make a write/read system. First I make this
And now I want to read this file and take from it x,y,z,rot coords . I try this but I don't know to continue
Please help me.
PHP код:
if(strcmp(cmd, "/carpark", true) == 0)
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
if(strcmp(name,"Petru_Chemp",false) == 0)
{
new Float:vehx, Float:vehy, Float:vehz;
GetVehiclePos(petrucar, vehx, vehy, vehz);
new Float:z_rot
GetVehicleZAngle(petrucar, z_rot);
new File:pos=fopen("petrucar.pos", io_write);
format(string, 256, "CreateVehicle(541, %f, %f, %f, %f, 1,2,0);", vehx, vehy, vehz, z_rot);
fwrite(pos, string);
fclose(pos);
}
}
PHP код:
readpetrucar()
{
new File:pos=fopen("petrucar.pos", io_read);
new Float:vehx, Float:vehy, Float:vehz;
GetVehiclePos(petrucar, vehx, vehy, vehz);
new Float:z_rot
new string[256]
GetVehicleZAngle(petrucar, z_rot);
format(string, 256, "CreateVehicle(541, %f, %f, %f, %f, 1,2,0);", vehx, vehy, vehz, z_rot);
while(fread(pos, string))
{
CreateVehicle(541, x,y,z,rot,2,1,0);
}
}
PHP код:
if(strcmp(cmd, "/mpon", true) == 0)
{
if(PlayerInfo[playerid][pAdmin] == 7)
{
readpetrucar();
}
}