SA-MP Forums Archive
SetPlayerPos, i need a basic script. - 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: SetPlayerPos, i need a basic script. (/showthread.php?tid=280449)



SetPlayerPos, i need a basic script. - Kindred - 01.09.2011

Well... i need a basic way to make it so that it GetPlayerPos's my position, then sets the giveplayerid's position slightly a little behind my character. Can someone show me a simple example? Thats all im asking, since i'm a Basic Scripter.


Re: SetPlayerPos, i need a basic script. - =WoR=Varth - 01.09.2011

https://sampforum.blast.hk/showthread.php?tid=280379
Why did you create double thread?


Re: SetPlayerPos, i need a basic script. - Jack_Leslie - 01.09.2011

pawn Код:
dcmd_gethere(playerid, params[]) //level 2
{
if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playerid, -1, "You're not an admin!");
new player;
if(sscanf(params, "u", player)) return SendClientMessage(playerid, -1, "USUAGE: /gethere [playerid]");
if(!IsPlayerConnected(player)) return SendClientMessage(playerid, -1, "Invalid player id!");
new Float:x,Float:y,Float:z;
GetPlayerPos(playerid, x, y, z);
SetPlayerPos(player, x+2, y+2, z);
SendClientMessage(player, COLOR_LIGHTRED, "You've been teleported!");
return 1;
}



Re: SetPlayerPos, i need a basic script. - Davz*|*Criss - 01.09.2011

pawn Код:
new Float:X,Float:Y,Float:Z;

GetPlayerPos(playerid, X,Y,Z);
SetPlayerPos(playerid, X,Y,Z +10);
This get player's position and drop him from 10 meters, If you simply use SetPlayerPos(playerid, X,Y,Z +10);
You will be droped but you will be teleported somewhere too, First you need to get Player's Position.

Thanks.


Re: SetPlayerPos, i need a basic script. - Horrible - 01.09.2011

Need INC:
ZCMD
SSCANF


pawn Код:
CMD:(playerid, params[])
{
new Float:X,Float:Y,Float:Z;
new target;
if(sscanf(params, "u", target)) return SendClientMessage(playerid, -1, "USUAGE: /get [playerid]");
if(!IsPlayerConnected(target)) return SendClientMessage(playerid, -1, "Invalid player id!");
GetPlayerPos(playerid, x, y, z);
SetPlayerPos(target, x+2, y+2, z);
SendClientMessage(target, 0x81CFAB00, "Someone Is teloprted you!");
return 1;
}



Re: SetPlayerPos, i need a basic script. - Kindred - 03.09.2011

Is it possible for u to make a timer with it too, so that when i type a command it will teleport the ID of the person i type in behind me a few meters, and each 1 second it continually teleports again and again until i type another command, it it would stop teleporting.


Re: SetPlayerPos, i need a basic script. - Luis- - 03.09.2011

Can I ask why you would want something like that? It'd annoy the shit out of me.


Re: SetPlayerPos, i need a basic script. - =WoR=Varth - 03.09.2011

Quote:
Originally Posted by -Luis
Посмотреть сообщение
Can I ask why you would want something like that? It'd annoy the shit out of me.
Quote:
Originally Posted by varthshenon
Посмотреть сообщение
There....


Re: SetPlayerPos, i need a basic script. - Luis- - 03.09.2011

I actually meant this.

Quote:
Originally Posted by KurtBag
Посмотреть сообщение
Is it possible for u to make a timer with it too, so that when i type a command it will teleport the ID of the person i type in behind me a few meters, and each 1 second it continually teleports again and again until i type another command, it it would stop teleporting.



Re: SetPlayerPos, i need a basic script. - =WoR=Varth - 03.09.2011

Quote:
Originally Posted by -Luis
Посмотреть сообщение
I actually meant this.
Did you even click on the link I gave to you?