SA-MP Forums Archive
CreateObject & AttachObjectToVehicle (++REP) - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: CreateObject & AttachObjectToVehicle (++REP) (/showthread.php?tid=418631)



CreateObject & AttachObjectToVehicle (++REP) - Lemonaidz - 25.02.2013

ok so i have my Object-
Quote:

AttachObjectToVehicle(objectid, vehicleid, -0.110000, 2.280004, -0.254999, 0.000000, 0.000000, 0.000000

i want to put that object in here under OnPlayerCommandText
Quote:

#define FILTERSCRIPT
#include <a_samp>
#pragma tabsize 0


public OnGameModeInit()
{
return 1;
}
stock DFT(vehicleid)
{
new result;
new model = GetVehicleModel(vehicleid);
switch(model)
{
case 578: result = model;
default: result = 0;
}
return result;

}
public OnPlayerCommandText(playerid, cmdtext[])

{
if (strcmp("/party", cmdtext, true, 10) == 0)
{

new vehid = GetPlayerVehicleID(playerid);
if(DFT(vehid))
{

for(new i = 0; i < MAX_PLAYERS; i++)
{
PlayAudioStreamForPlayer(i, "http://k006.kiwi6.com/hotlink/mx93jtrlp3/party.mp3");
}

//OBJECTS IN HERE


}
else
{
SendClientMessage(playerid, 0x804000,"You must be in a DFT-30");
}


return 1;
}
return 0;
}

public OnPlayerExitVehicle(playerid, vehicleid)
{
new vehid = GetPlayerVehicleID(playerid);
if(DFT(vehid))
{
SetWorldTime(12);
StopAudioStreamForPlayer(playerid);
return 1;
}
return 0;
}

How do i add the object so when i /party it adds the item on my vehicle
Wiki was confusing and no help


Re: CreateObject & AttachObjectToVehicle (++REP) - Jeffry - 25.02.2013

Try: http://pastebin.com/THMs497Z


Re: CreateObject & AttachObjectToVehicle (++REP) - Lemonaidz - 26.02.2013

Quote:
Originally Posted by Jeffry
Посмотреть сообщение
OMG dude thankyou soooo much, +Rep