Attach Objects to Vehicles
#1

I've created this command, using ZCMD & SSCANF
Код:
cmd(atachobject, playerid, parmas[])
{
	new objid;
	if(sscanf(parmas, "i", objid))return SendClientMessage(playerid, COLOR_WHITE, "/atachobject [ObjectID]");
	AttachObjectToVehicle(objid,GetPlayerVehicleID(playerid),0.0,0.0,0.3,0.0,0.0,0.0);
	return 1;
}
in game... nothing happens... what's wrong?
Reply
#2

Make sure the object you're attaching is actually created (:
Reply
#3

Quote:
Originally Posted by [03]Garsino
Посмотреть сообщение
Make sure the object you're attaching is actually created (:
Something like this?
Код:
cmd(atachobject, playerid, parmas[])
{
	new objid = CreateObject(objid,0.0,0.0,0.0,0.0,0.0,0.0);
	if(sscanf(parmas, "i", objid))return SendClientMessage(playerid, COLOR_WHITE, "/atachobject [ObjectID]");
	AttachObjectToVehicle(objid,GetPlayerVehicleID(playerid),0.0,0.0,0.3,0.0,0.0,0.0);
	return 1;
}
Reply
#4

i tested it this way

Код:
	if (strcmp("/attach", cmdtext, true, 10) == 0)	{
	GetVehiclePos(testcar,xt,yt,zt);
	AttachObjectToVehicle(testobject,testcar,xt,yt,zt,20,20,20);
	return 1;
	}
the object (testobject) is created and also nothing happens. I know it should work.. i saw the pictures
Reply
#5

If you did it that way you wouldn't need the sscanf line
Reply
#6

Quote:
Originally Posted by [03]Garsino
Посмотреть сообщение
If you did it that way you wouldn't need the sscanf line
you're right...
Reply
#7

[quote]If you did it that way you wouldn't need the sscanf line [/code]

LOL i didnt post that im just another scripter facing the same problem..nothing happens
Reply
#8

pawn Код:
cmd(atachobject, playerid, parmas[])
{
new model;
if(sscanf(parmas, "i", model))return SendClientMessage(playerid, COLOR_WHITE, "/atachobject [ObjectID]");
AttachObjectToVehicle(CreateObject(model,0.0,0.0,0.0,0.0,0.0,0.0),GetPlayerVehicleID(playerid),0.0,0.0,0.3,0.0,0.0,0.0);
return 1;
}
Reply
#9

Quote:
Originally Posted by D0erfler
Посмотреть сообщение
pawn Код:
cmd(atachobject, playerid, parmas[])
{
new model;
if(sscanf(parmas, "i", model))return SendClientMessage(playerid, COLOR_WHITE, "/atachobject [ObjectID]");
AttachObjectToVehicle(CreateObject(model,0.0,0.0,0.0,0.0,0.0,0.0),GetPlayerVehicleID(playerid),0.0,0.0,0.3,0.0,0.0,0.0);
return 1;
}
It says SERVER: UNKNOWN COMMAND ...
Reply
#10

You need zcmd ofc
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)