SA-MP Forums Archive
Find Personal Car - 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)
+--- Thread: Find Personal Car (/showthread.php?tid=304380)



Find Personal Car - CaTaLinU - 18.12.2011

Can someone help me with a script that it showing on map where is my personal car ?

Each player has 3 personal vehicles

i want to be
/locate 1
/locate 2
/locate 3

Thank you very much


Re: Find Personal Car - KingHual - 18.12.2011

Use SetPlayerCheckpoint .


Re: Find Personal Car - CaTaLinU - 18.12.2011

how ?


Re: Find Personal Car - Mean - 18.12.2011

https://sampwiki.blast.hk/wiki/SetPlayerCheckpoint

You can also use SetPlayerMapIcon.


Re: Find Personal Car - CaTaLinU - 18.12.2011

i'm not good at scripting
can you help me with the commands and script codes please ?


Re: Find Personal Car - [ABK]Antonio - 18.12.2011

I'm sure you can learn with that bit of information Mean posted. If you have any errors when trying to make the command, just post in this thread and we can help you out...I for one am not going to right the entire command for you. I'd rather you try it on your own and if you fail, post here with the problems.


Re: Find Personal Car - Mrki_Drakula - 18.12.2011

Off:
Quote:

#define Disappointment "A guy running into a wall with a boner and breaking his nose first"

Looooooool!!!!

OnTopic: Find the carownership part in the code and paste it here.


Re: Find Personal Car - CaTaLinU - 18.12.2011

how can i find that?


Re: Find Personal Car - PlayHard - 18.12.2011

pawn Код:
if(!strcmp("/locate1", cmdtext))
    {
        SetPlayerCheckpoint(playerid, x,y,z , 3.0);
        SendClientMessage(playerid, -1, "locate 1");
        return 1;
    }
    if(!strcmp("/locate2", cmdtext))
    {
        SetPlayerCheckpoint(playerid, x,y,z , 3.0);
        SendClientMessage(playerid, -1, "locate 2");
        return 1;
    }
    if(!strcmp("/locate3", cmdtext))
    {
        SetPlayerCheckpoint(playerid, x,y,z , 3.0);
        SendClientMessage(playerid, -1, "locate 3");
        return 1;
    }



Re: Find Personal Car - CaTaLinU - 18.12.2011

and instead of x,y,z what i need to put?


i have find this

Код:
public LoadAuto()
{
    new arrCoords[27][64];
	new strFromFile2[256];
	new File: file = fopen("auto.cfg", io_read);
	if (file)
	{
		new idx;
		while (idx < CAR_PROD)
		{
			fread(file, strFromFile2);
			split(strFromFile2, arrCoords, ',');
			AutoInfo[idx+1][aStats] = strval(arrCoords[0]);
			AutoInfo[idx+1][aModel] = strval(arrCoords[1]);
			AutoInfo[idx+1][aAutoX] = floatstr(arrCoords[2]);
			AutoInfo[idx+1][aAutoY] = floatstr(arrCoords[3]);
			AutoInfo[idx+1][aAutoZ] = floatstr(arrCoords[4]);
			AutoInfo[idx+1][aAutoAngle] = floatstr(arrCoords[5]);
			AutoInfo[idx+1][aColor1] = strval(arrCoords[6]);
			AutoInfo[idx+1][aColor2] = strval(arrCoords[7]);
			strmid(AutoInfo[idx+1][aOwner], arrCoords[8], 0, strlen(arrCoords[8]), 255);
			AutoInfo[idx+1][aPrice] = strval(arrCoords[9]);
			AutoInfo[idx+1][aKey] = strval(arrCoords[10]);
			AutoInfo[idx+1][aAlarm] = strval(arrCoords[11]);
			AutoInfo[idx+1][a0] = strval(arrCoords[12]);
			AutoInfo[idx+1][a1] = strval(arrCoords[13]);
			AutoInfo[idx+1][a2] = strval(arrCoords[14]);
			AutoInfo[idx+1][a3] = strval(arrCoords[15]);
			AutoInfo[idx+1][a4] = strval(arrCoords[16]);
			AutoInfo[idx+1][a5] = strval(arrCoords[17]);
			AutoInfo[idx+1][a6] = strval(arrCoords[18]);
			AutoInfo[idx+1][a7] = strval(arrCoords[19]);
			AutoInfo[idx+1][a8] = strval(arrCoords[20]);
			AutoInfo[idx+1][a9] = strval(arrCoords[21]);
			AutoInfo[idx+1][a10] = strval(arrCoords[22]);
			AutoInfo[idx+1][a11] = strval(arrCoords[23]);
			AutoInfo[idx+1][a12] = strval(arrCoords[24]);
			AutoInfo[idx+1][a13] = strval(arrCoords[25]);
			AutoInfo[idx+1][aPaintJob] = strval(arrCoords[26]);
			idx++;
		}
		fclose(file);
	}
	return 1;
}

public SaveAuto()
{
    new idx;
	new File: file2;
	while (idx < CAR_PROD)
	{
		new coordsstring[256];
		format(coordsstring, sizeof(coordsstring), "%d,%d,%f,%f,%f,%f,%d,%d,%s,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,\n",
		AutoInfo[idx+1][aStats],
		AutoInfo[idx+1][aModel],
		AutoInfo[idx+1][aAutoX],
		AutoInfo[idx+1][aAutoY],
		AutoInfo[idx+1][aAutoZ],
		AutoInfo[idx+1][aAutoAngle],
		AutoInfo[idx+1][aColor1],
		AutoInfo[idx+1][aColor2],
		AutoInfo[idx+1][aOwner],
		AutoInfo[idx+1][aPrice],
		AutoInfo[idx+1][aKey],
		AutoInfo[idx+1][aLock],
		AutoInfo[idx+1][aAlarm],
		AutoInfo[idx+1][a0],
		AutoInfo[idx+1][a1],
		AutoInfo[idx+1][a2],
		AutoInfo[idx+1][a3],
		AutoInfo[idx+1][a4],
		AutoInfo[idx+1][a5],
		AutoInfo[idx+1][a6],
		AutoInfo[idx+1][a7],
		AutoInfo[idx+1][a8],
		AutoInfo[idx+1][a9],
		AutoInfo[idx+1][a10],
		AutoInfo[idx+1][a11],
		AutoInfo[idx+1][a12],
		AutoInfo[idx+1][a13],
		AutoInfo[idx+1][aPaintJob]);
		if(idx == 0)
		{
			file2 = fopen("auto.cfg", io_write);
		}
		else
		{
			file2 = fopen("auto.cfg", io_append);
		}
		fwrite(file2, coordsstring);
		idx++;
		fclose(file2);
	}
	return 1;
}