Quantcast
Channel: SA-MP Forums
Viewing all articles
Browse latest Browse all 18226

Move player with their vehicle

$
0
0
Hi there,

Right now this /move command will only move a player's character, without their vehicle. What changes would be required to move both the player and the character?

Many thanks.

Code:

CMD:move(playerid, params[])
{
        if(PlayerInfo[playerid][Level] < 3)
            return SendClientMessage(playerid,red,"ERROR: You are not a high enough level to use this command");

    if(!strlen(params))
                return SendClientMessage(playerid, red, "USAGE: /move [up / down / forward / backward]");

        new Float:X, Float:Y, Float:Z;
        if(strcmp(params,"up",true) == 0) {
        GetPlayerPos(playerid,X,Y,Z);        SetPlayerPos(playerid,X,Y,Z+5); SetCameraBehindPlayer(playerid); }
        else if(strcmp(params,"down",true) == 0)        {
        GetPlayerPos(playerid,X,Y,Z);        SetPlayerPos(playerid,X,Y,Z-5); SetCameraBehindPlayer(playerid); }
        else if(strcmp(params,"backward",true) == 0)        {
        GetPlayerPos(playerid,X,Y,Z); SetPlayerPos(playerid,X,Y+5,Z);        }
        else if(strcmp(params,"forward",true) == 0)        {
        GetPlayerPos(playerid,X,Y,Z);        SetPlayerPos(playerid,X,Y-5,Z);        }
        else return SendClientMessage(playerid,red,"USAGE: /move [up / down / forward / backward]");
        return 1;
}


Viewing all articles
Browse latest Browse all 18226

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>