Script a Move -
S4t3K - 09.05.2014
Hi.
I'm trynna studying the pawn functions, and I am asking myself : how to make a function to move something.
Like MoveObject or MoveDynamicObject, but I would like to expand this to other pawn entities than objects.
Thanks in advance
Re: Script a Move -
rockhopper - 09.05.2014
here
https://sampwiki.blast.hk/wiki/MoveObject
You can add it with your ideas in cmds
Re: Script a Move -
rockhopper - 09.05.2014
Quote:
Hello, could you please define moving "something" ?
A player? Vehicle? Object? Pickup? Or?
|
he meant object read it carefully like Move object or Move Dunamic Object
Re : Script a Move -
S4t3K - 09.05.2014
@rockhopper : I don't wanna like to Move Objects, but for example Pickups, the whole map, vehicles, I just want to know how the MoveObject function works, with the time parameter (I think I've made something good but I don't know how to do with a speed (units per second) parameter)
@Ralfie : For example, what you've said.
Re: Script a Move -
rockhopper - 09.05.2014
you can try for example using zcmd
Код:
CMD:moveplayer(playerid, params[])
{
new Float:x
new Float:y
new Float:z
if(GetPlayerPos(playerid, Float:x, Float:y, Float:z))
SetPlayerPos(playerid, Float:x +3,Float:y +2,Float:z);
}
USING THIS THE PLAYER will move
Re : Script a Move -
S4t3K - 09.05.2014
Just want a function, and for example, if I input
PHP код:
MovePlayer(playerid, hisXpos, hisYpos, hisZpos, 0.0, 0.0, 0.0, 3.0) // The last one is the speed parameter
Show me a good code which shows how would you do because I've not find yet.
I don't want a ready made code for what I want, just either the source code of Move(Dynamic)Object or a very nice example.
Re: Script a Move -
rockhopper - 09.05.2014
Код:
public PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z)
{
if(IsPlayerConnected(playerid))
{
new Float:oldposx, Float:oldposy, Float:oldposz;
new Float:tempposx, Float:tempposy, Float:tempposz;
GetPlayerPos(playerid, oldposx, oldposy, oldposz);
tempposx = (oldposx -x);
tempposy = (oldposy -y);
tempposz = (oldposz -z);
//printf("DEBUG: X:%f Y:%f Z:%f",posx,posy,posz);
if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
{
return 1;
}
}
return 0;
}
TRY POINTTOPOINT
TAKEN FROM
https://sampforum.blast.hk/showthread.php?tid=52205
Re: Script a Move -
rockhopper - 09.05.2014
you can look at this too
https://sampwiki.blast.hk/wiki/GetPlayerDistanceFromPoint
Re : Script a Move -
S4t3K - 09.05.2014
I think you didn't understood.
I hope that I use the proper words to express myself. I will try to reformulate.
You see, you can moove object using MoveObject function.
I would like to do the same but with pickups, and I'd like to create a MovePickup function.
Do you know what I mean ?
But I've tried several ways to proceed, and all were either not working or teleporting directly the object instead of moving him (because the only advantage of the moving is that you can see the object position change, whereas with "SetObjectPos", you directly see the new pos).
If I expressed bad again, sorry, I'll try to do better next time
@Ralfie : Yeah, but for pickups ? And for 3DTextLabels ?
Re : Script a Move -
S4t3K - 09.05.2014
Incognito did on his plugin, even if it's in C++, i'm sure you can do almost the same in pawn (almost, not exactly, for sure, but almost
)