5 posts in this topic

Здравствуйте!

Команда для парковки автомобиля.

Автор: Kostyaev

Спойлер

if(strcmp(cmd, "/park", true) == 0)
{
        if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_GRAD2, "Вы должны быть в авто");
        new cars = GetPlayerVehicleID(playerid);
        if(GetRealID(cars) == -1) return SendClientMessage(playerid, COLOR_GRAD2, "Вы должны быть в своём авто");
        if(!strcmp(CarInfo[GetRealID(cars)][cOwner],Name(playerid),false)||!strcmp(CarInfo[GetRealID(cars)][cOwnerm],Name(playerid),false))
        {
            CarInfo[GetRealID(cars)][cFrontBullbars] = 0;
            GetVehiclePos(cars, CarInfo[GetRealID(cars)][cPx],CarInfo[GetRealID(cars)][cPy],CarInfo[GetRealID(cars)][cPz]);
            GetVehicleZAngle(cars, CarInfo[GetRealID(cars)][cPa]);
            SendClientMessage(playerid, -1, "Теперь ваш автомобиль будет припаркован в этом месте");
            SaveCar(GetRealID(cars));
            return 1;
        }
        else return SendClientMessage(playerid, COLOR_GRAD2, "Это не ваш транспорт");
    } 

 

Спойлер

if(strcmp(cmd, "/apark", true) == 0)
{
        if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_GRAD2, "Вы должны быть в авто");
        new cars = GetPlayerVehicleID(playerid);
        if(ServerClosed==1){SendClientMessage(playerid, COLOR_GRAD2, "Кмд временно не работает");return 1;}
        if(GetRealID(cars) == -1) return SendClientMessage(playerid, COLOR_GRAD2, "Вы должны быть в своём авто");
        if(PlayerInfo[playerid][pAdmin] >= 3)
        {
            GetVehiclePos(cars, CarInfo[GetRealID(cars)][cPx],CarInfo[GetRealID(cars)][cPy],CarInfo[GetRealID(cars)][cPz]);
            GetVehicleZAngle(cars, CarInfo[GetRealID(cars)][cPa]);
            SaveCar(GetRealID(cars));
            SendClientMessage(playerid, COLOR_GRAD2, "Теперь этот автомобиль будет припаркован в этом месте");
            return 1;
    }

 

 

Share this post


Link to post
Share on other sites

Не работает ошибки кидает.Вот:
C:\Users\Aleks\Downloads\MRP.pwn(8577) : error 017: undefined symbol "cmd"
C:\Users\Aleks\Downloads\MRP.pwn(8579) : error 029: invalid expression, assumed zero
C:\Users\Aleks\Downloads\MRP.pwn(8579) : error 029: invalid expression, assumed zero
C:\Users\Aleks\Downloads\MRP.pwn(8579) : error 029: invalid expression, assumed zero
C:\Users\Aleks\Downloads\MRP.pwn(8579) : fatal error 107: too many error messages on one line

Помогите пожалуйста

Share this post


Link to post
Share on other sites

@KaS tAuS new cmd[128]; 

в начало OnPlayerCommandText

Share this post


Link to post
Share on other sites

У меня ошибки!

C:\Users\åëåíà\Desktop\Ðàáîòà\arizona.pwn(40156) : error 017: undefined symbol "GetRealID"
C:\Users\åëåíà\Desktop\Ðàáîòà\arizona.pwn(40157) : error 017: undefined symbol "CarInfo"
C:\Users\åëåíà\Desktop\Ðàáîòà\arizona.pwn(40157) : error 017: undefined symbol "GetRealID"
C:\Users\åëåíà\Desktop\Ðàáîòà\arizona.pwn(40157) : error 029: invalid expression, assumed zero
C:\Users\åëåíà\Desktop\Ðàáîòà\arizona.pwn(40157) : fatal error 107: too many error messages on one line
 

Share this post


Link to post
Share on other sites

@Leonov заменяйте переменные под свои системы. Команда подойдет без лишних правок только для модов GreenTech и подобных. 

Share this post


Link to post
Share on other sites

Your content will need to be approved by a moderator

Guest
You are commenting as a guest. If you have an account, please sign in.
Reply to this topic...

×   You have pasted content with formatting.   Remove formatting

  Only 75 emoticons maximum are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

Loading...
Sign in to follow this  
Followers 0

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • Guest володя
      By Guest володя
      C:\Users\vilin\Desktop\Hot RP\gamemodes\hot.pwn(67) : warning 215: expression has no effect
      C:\Users\vilin\Desktop\Hot RP\gamemodes\hot.pwn(114 -- 121) : error 001: expected token: "-string end-", but found "-identifier-"
      C:\Users\vilin\Desktop\Hot RP\gamemodes\hot.pwn(121) : warning 217: loose indentation
      C:\Users\vilin\Desktop\Hot RP\gamemodes\hot.pwn(121) : warning 215: expression has no effect
      C:\Users\vilin\Desktop\Hot RP\gamemodes\hot.pwn(121 -- 124) : warning 215: expression has no effect
      Pawn compiler 3.2.3664              Copyright (c) 1997-2006, ITB CompuPhase

      1 Error.
      Вот код: