4 posts in this topic

В public OnPlayerCommandText

Спойлер

if(strcmp(cmd, "/tpcor", true) == 0)
{
    if(!IsPlayerConnected(playerid)) return 1;
    if(PlayerInfo[playerid][pAdmin] < 10) return SendClientMessage(playerid,COLOR_GREY,"Недоступно!");
        tmp = strtok(cmdtext, idx);
    if(!strlen(tmp)) return SendClientMessage(playerid,-1,"ИНФО: /tpcor x y z");
    new coorx;
    coorx = strval(tmp);
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp)) return SendClientMessage(playerid,-1,"ИНФО: /tpcor x y z");
    new coory;
    coory = strval(tmp);
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp)) return SendClientMessage(playerid,-1,"ИНФО: /tpcor x y z");
    new coorz;
    coorz = strval(tmp);
    SetPlayerPos(playerid,coorx,coory,coorz);
    format(string, sizeof(string), "Вы телепортировались!", coorx,coory,coorz);
    SendClientMessage(playerid, COLOR_WHITE, string);
        return 1;
}

 

 

Использование:

/tpcor 2092.7043 -2658.3269 12.3637

Без запятых!

 

Share this post


Link to post
Share on other sites

я не могу загрузить у меня в public твоем там нечего нету

Share this post


Link to post
Share on other sites

dc_cmd плиз

Share this post


Link to post
Share on other sites

@SenyaLi_e 

CMD:tpcor(playerid, params[])
{
    if(!IsPlayerConnected(playerid)) return 1;
    if(PlayerInfo[playerid][pAdmin] < 10return SendClientMessage(playerid,COLOR_GREY,"Недоступно!");
    new Float:coorx,Float:coory,Float:coorz;
    if(sscanf(params, "fff", coorx, coory, coorz)) return SendClientMessage(playerid,-1,"ИНФО: /tpcor x y z");
    SetPlayerPos(playerid,coorx,coory,coorz);
    format(string, sizeof(string), "Вы телепортировались на координаты: X = %.02f | Y = %.02f | Z = %.02f", coorx,coory,coorz);
    return SendClientMessage(playerid, COLOR_WHITE, string);
}

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • Larikze1231
      By Larikze1231
      Здраствуйте, помогите решить проблему, убрал логотип аризоны но появился красный квадрат в низу, как убрать его? буду очень благодарен если поможете!