30.12.2010, 13:32
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;
}