Рекомендованные сообщения



4 posts in this topic

Есть команда которая ставит наклейку на авто(Инфернус), но мне надо что бы при удалении авто наклейка тоже удалялась.

Сама команда:

	if(strcmp("/testcar", cmdtext, true) == 0)
	{
		if(PlayerInfo[playerid][pNakleika] == 0 && !IsPlayerInAnyVehicle(playerid)) SendClientMessage(playerid, 0xFFFFFFAA, "У вас нету этой наклейки либо вы не в машине!");
		else
		{
		ccara = GetPlayerVehicleID(playerid);
		tmpobjid = CreateObject(-1019,0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
		AttachObjectToVehicle(tmpobjid, ccara, 0.000, 1.965, 0.131, 79.800, 0.000, 0.000);
		return 1;
		}
	}

 

Share this post


Link to post
Share on other sites
if(strcmp("/testcar", cmdtext, true) == 0)
{
    if(PlayerInfo[playerid][pNakleika] == 0 && !IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0xFFFFFFAA, "У вас нету этой наклейки либо вы не в машине!");
    else
    {
        if(GetPVarInt(playerid, "testcar") != 1)
    	{
            ccara = GetPlayerVehicleID(playerid);
            tmpobjid = CreateObject(-1019,0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
            AttachObjectToVehicle(tmpobjid, ccara, 0.000, 1.965, 0.131, 79.800, 0.000, 0.000);
            SetPVarInt(playerid, "testcar", 1);
        }
        else 
        {
            DestoryObject(tmpobjid);
            SetPVarInt(playerid, "testcar", 0);
        }
        return 1;
    }
}

Примерно так

Edited by MuhammadPawn

Share this post


Link to post
Share on other sites
6 минут назад, MuhammadPawn сказал:

if(strcmp("/testcar", cmdtext, true) == 0)
{
    if(PlayerInfo[playerid][pNakleika] == 0 && !IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0xFFFFFFAA, "У вас нету этой наклейки либо вы не в машине!");
    else
    {
        if(GetPVarInt(playerid, "testcar") != 1)
    	{
            ccara = GetPlayerVehicleID(playerid);
            tmpobjid = CreateObject(-1019,0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
            AttachObjectToVehicle(tmpobjid, ccara, 0.000, 1.965, 0.131, 79.800, 0.000, 0.000);
            SetPVarInt(playerid, "testcar", 1);
        }
        else 
        {
            DestoryObject(tmpobjid);
            SetPVarInt(playerid, "testcar", 0);
        }
        return 1;
    }
}

Примерно так


Ошибку pawno выдаёт: error 017: undefined symbol "DestoryObject"

Share this post


Link to post
Share on other sites

@AlexWiDe Прости не так написал (замени на DestroyObject) 

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  
Followers 0

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • Zaire
      By Zaire
      CMD:ban(playerid, params[]) { if(!PlayerInfo[playerid][pLogged]) return true; if(PlayerInfo[playerid][pAdmin] < 3 || AdminLogged[playerid] == false) return true; if(sscanf(params, "uis[64]", params[0], params[1], params[2])) return SendClientMessage(playerid, COLOR_GREY, "Èñïîëüçîâàíèå: /ban [id/íèê èãðîêà] [êîë-âî äíåé] [ïðè÷èíà]"); if(!IsPlayerConnected(params[0]) || params[0] == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_GREY, ""TPLAYEROFFLINE""); if(!PlayerInfo[params[0]][pLogged]) return SendClientMessage(playerid, COLOR_GREY, ""TPLAYERNLOGGED""); if(PlayerInfo[params[0]][pDebugUser]) return SendClientMessage(playerid, COLOR_GREY, ""TPLAYEROFFLINE""); if(PlayerInfo[params[0]][pAdmin] >= 1339) return SendClientMessage(playerid, COLOR_GREY, "Ýòîò èãðîê Îñíîâàòåëü! Åãî íå âîçìîæíî çàáëîêèðîâàòü!"); if(params[1] > 365 && params[1] != -1 || params[1] < 1 && params[1] != -1 ) return SendClientMessage(playerid, COLOR_GREY, "Êîë-âî äíåé îò 1 äî 365!"); if(params[1] == -1 && PlayerInfo[playerid][pAdmin] < 1339) return SendClientMessage(playerid, COLOR_GREY, "Âû íå ìîæåòå çàáëîêèðîâàòü èãðîêà íàâñåãäà!"); if(!AddPlayerBan(params[0], playerid, params[1], params[2])) {