/z /y /x commands
#5

Here all three commands are in dcmd:

put under OnPlayerCommandText
Код:
{
     dcmd(x, 1, cmdtext);
     dcmd(y, 1, cmdtext);
     dcmd(z, 1, cmdtext);
}

dcmd_x(playerid, params[])
{
     new
          Float:x,
          Float:y,
          Float:z;
     if(!strlen(params))
       return SendClientMessage(playerid, 0xFFFF00FF, "USAGE: \"/x [positive or negative float]\"");
     GetPlayerPos(playerid, x, y, z);
     SetPlayerPos(playerid, x+params, y, z);
     return true;
}

dcmd_y(playerid, params[])
{
     new
          Float:x,
          Float:y,
          Float:z;
     if(!strlen(params))
       return SendClientMessage(playerid, 0xFFFF00FF, "USAGE: \"/y [positive or negative float]\"");
     GetPlayerPos(playerid, x, y, z);
     SetPlayerPos(playerid, x, y+params, z);
     return true;
}

dcmd_z(playerid, params[])
{
     new
          Float:x,
          Float:y,
          Float:z;
     if(!strlen(params))
       return SendClientMessage(playerid, 0xFFFF00FF, "USAGE: \"/z [positive or negative float]\"");
     GetPlayerPos(playerid, x, y, z);
     SetPlayerPos(playerid, x, y, z+params);
     return true;
}
Should work.
Reply


Messages In This Thread
/z /y /x commands - by [SW]thekillaer - 01.12.2009, 21:11
Re: /z /y /x commands - by LarzI - 01.12.2009, 21:27
Re: /z /y /x commands - by [SW]thekillaer - 01.12.2009, 22:07
Re: /z /y /x commands - by LarzI - 01.12.2009, 22:51
Re: /z /y /x commands - by Niixie - 02.12.2009, 16:25

Forum Jump:


Users browsing this thread: 1 Guest(s)