Jump to content
  • 0

attach


PauLL

Question

Am facut attach object to vehicle EXACT ca in tutorialul lui gireada ,arata masina da rnu arata obiectul atasat.Ce sa fac?

[pawn]obiectsultan = CreateObject(19310, 0.0, 0.0, 0.0,  0.00000, 0.00000, 0.0);

  AttachObjectToVehicle(obiectsultan,TAXI4, 0.01334, -0.71075, 0.92159,  0.00000, 0.00000, -91.14000);[/pawn]

am pus sus cu new ... etc nu imi da NICIO eroare dar nu se vede obiectul.

Link to comment
Share on other sites

9 answers to this question

Recommended Posts

Eu o sa iti dau un exemplu de FS , daca vrei sa il urmezi foarte bine :) merge bagat si direct in GM stii tu sa modifici ( cred)

Prima oara include-urile (eu folosesc doar ZCMD , deci iti dau exemplu pe ZCMD)

#include <a_samp>
#include <zcmd>
Acuma defines
#define COLOR_ORANGE                                            0xFF9900AA
#define COLOR_RED												0xFF0000AA
#define Car_Owner1                                              "[PhX]Exc1siOn[PhX]"
Unde "[PhX]Exc1siOn[PhX]" este numele Ownerului masinii News
new exc1veh,
OnFilterScriptInit (daca vrei sa fie ca FS ) OnGameModeInit (daca vrei sa fie in GM) Eu o sa iti scriu cu FilterScript
public OnFilterScriptInit()
{
	//--------------------------------------------------------------------------
	LoadCar1();
	//--------------------------------------------------------------------------
	return 1;
}
Commands MyCar , sa iti teleporteze la tine masinile la care esti owner:)
CMD:mycar(playerid, params[])
{
	if(strcmp(pName(playerid), Car_Owner1, true) == 0)
	{
		if(!IsPlayerInAnyVehicle(playerid))
		{
		    GetPlayerPos(playerid, x,y,z);	SetVehiclePos(exc1veh, x+2,y+2,z);
		    PutPlayerInVehicle(playerid, exc1veh, 0);	   Success(playerid);
		}
		else ErrorMSG(playerid);
	}
	return 1;
}
public OnPlayerStateChange
//--------------------------------------------------------------------------
        new vehicleid = GetPlayerVehicleID(playerid);
	//--------------------------------------------------------------------------
	if(newstate == PLAYER_STATE_DRIVER)
	{
	    if(vehicleid == exc1veh && GetVehicleModel(vehicleid) == 560)
	    {
			if(strcmp(pName(playerid), Car_Owner1, true) == 0 || IsPlayerAdmin(playerid))
   			{
				return 1;
			}
			else
			{
				GetPlayerPos(playerid, x,y,z);	SetPlayerPos(playerid, x,y,z+5);
				return Errors(playerid, 1);
			}
		}
        }
	return 1;
}
Stocks (Stock-ul pName nu este necesar daca il vei baga in GM)
stock pName(playerid)
{
	new Name[MAX_PLAYER_NAME];
	GetPlayerName(playerid, Name, 24);
	return Name;
}
//------------------------------------------------------------------------------
stock Errors(playerid, EID)
{
	new string[90];
	//--------------------------------------------------------------------------
	if(EID == 1)
	{
	    format(string, 90, "~w~You are not my owner~n~~r~%s", Car_Owner1);
	}
        return GameTextForPlayer(playerid, string, 5000, 4);
}
//------------------------------------------------------------------------------
stock Success(playerid)
{
	return SendClientMessage(playerid, COLOR_ORANGE, "You have Succesfully spawned your Personal Car!");
}
//------------------------------------------------------------------------------
stock ErrorMSG(playerid)
{
	return SendClientMessage(playerid, COLOR_RED, "ERROR: You allready have a vehicle!");
}
//------------------------------------------------------------------------------
stock LoadCar1()
{
      //--------------------------------------------------------------------------
	new obiectsultan;
	//==========================================================================
	SetVehicleNumberPlate(exc1veh, "{FF0000}[PhX]"); //Modifici [PhX] cu ce vrei tu sa apara la masina ta (number plate)
	exc1veh = AddStaticVehicle(560,200.4643,-2604.0471,6.9274,5.5493,0,0); // dupa 560, sunt coordonatele unde sa fie masina modifici tu dupa bunul plac:)
	SetVehicleNumberPlate(exc1veh, "{FF0000}[PhX]"); // Modifici [PhX] cu ce vrei tu sa apara la masina ta (number plate)
	//--------------------------------------------------------------------------
	obiectsultan = CreateObject(19310, 0.0, 0.0, 0.0,   0.00000, 0.00000, 0.0);
	//--------------------------------------------------------------------------
        AttachObjectToVehicle(obiectsultan, exc1veh, 0.01334, -0.71075, 0.92159,   0.00000, 0.00000, -91.14000);
	//--------------------------------------------------------------------------
}

Daca nu ai inteles ceva , o functie sau ceva , lasa reply :) te voi ajuta

Succes

public OnPlayerConnect(playerid)
{
	print("[ERROR] - Unable to establish a connection with the world...");
	SendRconCommand("exit");
	return 1;
}

 

Link to comment
Share on other sites

yo tiam facut direct tot :) da daca nu intelegi ce sati fac incearcal intrun FS :P sa vezi ca merge

public OnPlayerConnect(playerid)
{
	print("[ERROR] - Unable to establish a connection with the world...");
	SendRconCommand("exit");
	return 1;
}

 

Link to comment
Share on other sites

Uitete mai clar , inainte de a vorbi UITETE LA TOT dai in jos si vei vedea ca la STOCKS ESTE in fine laso balta daca nu stii nici macar sa te uiti ce sa mai vorbesc de adaugat...eu miam facut treaba de a ajuta restu...depinde de u:P

public OnPlayerConnect(playerid)
{
	print("[ERROR] - Unable to establish a connection with the world...");
	SendRconCommand("exit");
	return 1;
}

 

Link to comment
Share on other sites

AtachObject nu se pune la OnGameModeInit ai sa vezi ca si eu or sati spuna la fel :)

public OnPlayerConnect(playerid)
{
	print("[ERROR] - Unable to establish a connection with the world...");
	SendRconCommand("exit");
	return 1;
}

 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.