coordonatesavecommand problem
#1

ok i made a coodonatessavecommand:
Код:
if(!strcmp(cmd, "/ssave", true))
	{
		if(IsPlayerAdmin(playerid))
		{
			//Position
			new string1[128];
			new Float:XCoordsSave, Float:YCoordsSave, Float:ZCoordsSave;	
			GetPlayerPos(playerid, XCoordsSave, YCoordsSave, ZCoordsSave);
			
			//Sound
			new Float:XCoordsSaveSound, Float:ZCoordsSaveSound, Float:YCoordsSaveSound
			GetPlayerPos(playerid, XCoordsSaveSound, YCoordsSaveSound, ZCoordsSaveSound);
			PlayerPlaySound(playerid,1150,XCoordsSaveSound, YCoordsSaveSound, ZCoordsSaveSound);
			
			//Position
			new File:pos=fopen("CoordonatesSaves.txt", io_append);
			format(string1, 256, "%s\r\n {%f, %f, %f}", XCoordsSave, YCoordsSave, ZCoordsSave);
			fwrite(pos, string1);
			fclose(pos);
			SendClientMessage(playerid,COLOR_RED,"Racepoint gespeichert!");
		}
		else
		{
			SendClientMessage(playerid,COLOR_RED,"Du musst Admin sein um das machen zu kцnnen!");
		}
		return 1;
	}
Нt save the Coordonates, but with Errors:

Код:
{-1655.850708, 13.881608, 0.000000}
{-1654.343261, 13.994992, 0.000000}ч
{-1657.223510, 13.926807, 0.000000}Š
{-1580.377563, 24.313919, 0.000000}л
{-1668.388549, 13.343750, 0.000000}

{-1670.535888, 13.335947, 0.000000}
Код:
1. -> (л,ч,) ????
2. there is something wrong with the Z Angle, what??


BMGP
Reply
#2

pawn Код:
//Sound
            new Float:XCoordsSaveSound, Float:ZCoordsSaveSound, Float:YCoordsSaveSound
            GetPlayerPos(playerid, XCoordsSaveSound, YCoordsSaveSound, ZCoordsSaveSound);
            PlayerPlaySound(playerid,1150,XCoordsSaveSound, YCoordsSaveSound, ZCoordsSaveSound);
You do not need the position, since play player sound is bugged and works with every position. Just put zeros in

pawn Код:
format(string1, 256, "%s\r\n {%f, %f, %f}", XCoordsSave, YCoordsSave, ZCoordsSave);
Why the %s ?
Reply
#3

i saw that in wikipedia to start every /ssave a new line^^

Should i use PlayerPlaySound(playerid,1150,1,1,1); or anything?! cause i see the 1,1,1 very often xD
Reply
#4

The %s is a replacement for strings. Get rid of it, since you're formating floats only.
To start a new line, use \n or \r\n which will start a new line and write at the beginning of it.

Also, you can do
PlayerPlaySound(playerid,1150,1,1,1); or
PlayerPlaySound(playerid,1150,0,0,0); or
PlayerPlaySound(playerid,1150,1337,1337,1337);

because it is bugged and the last 3 numbers are irrelevant
Reply
#5

Quote:
Originally Posted by dice7
Also, you can do
PlayerPlaySound(playerid,1150,1,1,1); or
PlayerPlaySound(playerid,1150,0,0,0); or
PlayerPlaySound(playerid,1150,1337,1337,1337);

because it is bugged and the last 3 numbers are irrelevant
Dude they are not irrelevant... They are parameters for playing a sound at a specific position. And it works for me.
Reply
#6

Well it doesn't work for me, nor the people on my server
Reply
#7

juhu it works!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)