SA-MP Forums Archive
SetPlayerPosition - 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: SetPlayerPosition (/showthread.php?tid=371319)



SetPlayerPosition - Vizi - 23.08.2012

Hi,
Can somebody help me,i want to have more setplayerposition on 1 command rondomly.
Exemple:
Now,when i /prison somebody to go to this cord....
pawn Код:
1849.32995605,-1714.31005859,5201.54003906
Or to go to another cord...
You anderstand?
Iwant to choose rondomly sometimes antoher cord... another cord.....


Re: SetPlayerPosition - _Khaled_ - 23.08.2012

What command processor do you use?


Re: SetPlayerPosition - Akira297 - 23.08.2012

Код:
new Float:OOCPrisonSpawns[3][3] = {
	{-304.4369,1894.9891,29.8929},
	{-295.9042,1894.9121,29.8929},
	{-287.1133,1894.6259,29.8929}
};
Код:
			new rand = random(sizeof(OOCPrisonSpawns));
			Streamer_UpdateEx(giveplayerid, OOCPrisonSpawns[rand][0], OOCPrisonSpawns[rand][1], OOCPrisonSpawns[rand][2]);
			SetPlayerPos(giveplayerid, OOCPrisonSpawns[rand][0], OOCPrisonSpawns[rand][1], OOCPrisonSpawns[rand][2]);
Alittle tired.. hope this helped


Change the Cords to yours.


Re: SetPlayerPosition - RenSoprano - 23.08.2012

pawn Код:
new Float:Jail[4][3] = { // If you want more change this numbers
{1849.32995605,-1714.31005859,5201.54003906},
{bla,bla,bla},
{bla,bla,bla},
{bla,bla,bla}
};
Hope it helped


Re: SetPlayerPosition - _Khaled_ - 23.08.2012

If default one..
pawn Код:
if(!strcmp(cmdtext, "/prison"))
     {
        SendClientMessage(playerid, 0xFFFFFFFF, "You've been sent to prison.");
        SetPlayerInterior(playerid,***);
        SetPlayerPos(playerid,1849.32995605,-1714.31005859,5201.54003906);
        SetPlayerFacingAngle(playerid,0.0);
        SetCameraBehindPlayer(playerid);
        return 1;
     }
}



Re: SetPlayerPosition - _Khaled_ - 23.08.2012

or you can use float, but you'll need to make a timer also..


Re: SetPlayerPosition - Vizi - 23.08.2012

Soprano, how to meke that only for /prison command?To add on the /prison command or?