CMD:Moveplayer
#1

Hey,
How can i make command /moveplayer same like /move, i have only /move command in my server so i want to make /moveplayer
Code of /move

PHP код:
CMD:move(playerid,params[])
{
    if(
pInfo[playerid][pLevel] >= 3)
    {
        if(
pInfo[playerid][Move] == 0)
        {
            
TogglePlayerControllable(playerid,false);
            
CommandToAdmins(playerid,"move (Turned on)");
            
SetCameraBehindPlayer(playerid);
            
pInfo[playerid][Move] = 1;
            
SendClientMessage(playeridyellow"Move system turned On!");
            
SendClientMessage(playeridyellow"Use UP/DOWN keys to move forward/back, LEFT/RIGHT key to trun Left/Right and Sprint/Jump keys to move UP/Down!");
        }
        else
        {
            
TogglePlayerControllable(playerid,true);
            
CommandToAdmins(playerid,"move (Turned off)");
            
SetCameraBehindPlayer(playerid);
            
pInfo[playerid][Move] = 0;
            
SendClientMessage(playeridyellow"Move system turned off");
        }
        return 
1;
    }
    else return 
ShowMessage(playeridred1);
}
#endif 
Thanks
Reply
#2

I'm not not sure what you are trying to accomplish here, are you trying to move the player when you use the buttons?
Reply
#3

Lol not to rename, i saw in admin System FS there is command /moveplayer so you can move the player up, down, left etc.. with this command.
So i want to make one in my Admin System ..
Reply
#4

Quote:
Originally Posted by TwiiKzz
Посмотреть сообщение
Lol not to rename, i saw in admin System FS there is command /moveplayer so you can move the player up, down, left etc.. with this command.
So i want to make one in my Admin System ..
1. Freeze the player
2. Get his current XYZ coordinates
3. Handle your input for moving him left-right-up-down-(for|back)ward
4. Calculate his next position
5. Update his position.
6. Goto pt. 3.

Here you are. That's all you need to know to solve your problem. As simple as possible.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)