Help on a command: /front <x,y or z> <amount>
#4

pawn Код:
dcmd_front(playerid,params[])
{
    new pos[4], amount;
    new tmp[128], Index;
    tmp = strtok(params, Index);
    format(pos, sizeof(pos), "%s", tmp);
    tmp = strtok(params, Index);
    amount = strval(tmp);
    if(!strlen(params) || !strlen(tmp)) return SendClientMessage(playerid, color, "USAGE: /front <x,y,z> <amount");
    new Float:Posx,Float:Posy,Float:Posz;
    GetPlayerPos(playerid, Posx, Posy, Posz);
    if(!strcmp(pos,"x",true))
    {
        SetPlayerPos(playerid, Posx+amount,Posy,Posz);
    }
    else if(!strcmp(pos,"y",true))
    {
        SetPlayerPos(playerid, Posx,Posy+amount,Posz);
    }
    else if(!strcmp(pos,"z",true))
    {
        SetPlayerPos(playerid, Posx,Posy,Posz+amount);
    }
    else
    {
        SendClientMessage(playerid, color, "You can only choose: x, y or z");
    }
    return 1;
}
Reply


Messages In This Thread
Help on a command: /front <x,y or z> <amount> - by blackwave - 30.12.2010, 13:23
Re: Help on a command: /front <x,y or z> <amount> - by _rAped - 30.12.2010, 13:27
Re: Help on a command: /front <x,y or z> <amount> - by blackwave - 30.12.2010, 13:30
Re: Help on a command: /front <x,y or z> <amount> - by MadeMan - 30.12.2010, 13:32
Re: Help on a command: /front <x,y or z> <amount> - by blackwave - 30.12.2010, 13:34
Re: Help on a command: /front <x,y or z> <amount> - by _rAped - 30.12.2010, 13:34

Forum Jump:


Users browsing this thread: 2 Guest(s)