XMAS Car problem!
#1

Car is doesn't deleting after repeat the command.
'X-MAS' text is invisible.
Where is problem in this two things?
Код:
CMD:car(playerid, params[])
{
	new car[MAX_PLAYERS];
	DestroyVehicle(car[playerid]);
	new Float:x, Float:y, Float:z, Float:angle;
	GetPlayerPos(playerid, x, y, z);
	GetPlayerFacingAngle(playerid, angle);
	car[playerid] = CreateVehicle(562, x, y, z, angle, 3, 3, -1);
	new xmasobject = CreateObject(19329,0,0,-1000,0,0,0,100);
	AttachObjectToVehicle(xmasobject, GetPlayerVehicleID(playerid), 0.000000,-2.325000,0.150000,-8.100000,0.000000,0.000000);
    SetObjectMaterialText(xmasobject, "X-MAS", 0, 130, "Arial", 30, 0, -1, 0, 1);
	PutPlayerInVehicle(playerid, car[playerid], 0);
	return 1;
}
Reply
#2

You declare the 'car' variable inside the command, which, I think, causes the variable to be set to 0 or something, which is the reason for the old car not being deleted.
Remove the 'new car[MAX_PLAYERS];' from the command, and place it outside any callbacks in your script, if it doesn't already exist.
About the text being invisible, maybe the material index in the SetObjectMaterialText is wrong? It's the '0' after "X-MAS', try changing that. Not sure about this one though.
Reply
#3

Okay spawning works.
This '0' in text is a index so it is correct. Everything should be good in line with material, I made it in editor.

EDIT:
SOLVED! I changed GetPlayerVehicleID to car[playerid] and works good!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)