Object isnt visable
#1

Код:
 
CMD:siren(playerid, params[])
{
	if(pInfo[playerid][Faction] = 1)
	{
		new string[128], type;
		new VID = GetPlayerVehicleID(playerid);
		if(sscanf(params, "d", type))
		{
			SendClientMessage(playerid, COLOR_WHITE, "USAGE: /siren [type]");
			SendClientMessage(playerid, COLOR_GRAD2, "Type: 1 = Inside, 2 = Roof, 3 = Off.");
			return 1;
		}
		switch(type)
		{
		case 1:
			{
				if(Siren[VID] == 1)
				{
					SendClientMessage(playerid, COLOR_GRAD2, "This vehicle already has a siren!");
					return 1;
				}
 				new sendername[MAX_PLAYER_NAME];
     			Siren[VID] = 1;
		        GetPlayerName(playerid, sendername, sizeof(sendername));
		        SirenObject[VID] = CreateObject(18646, 10.0, 10.0, 10.0, 0, 0, 0);
		        AttachObjectToVehicle(SirenObject[VID], VID, 0.0, 0.75, 0.275, 0.0, 0.1, 0.0);
		        format(string, sizeof(string), "* %s puts the siren on the dashboard.", sendername);
			return 1;
			}
		case 2:
			{
				if(Siren[VID] == 1)
				{
					SendClientMessage(playerid, COLOR_GRAD2, "This vehicle already has a siren!");
				return 1;
				}
                        Siren[VID] = 1;
                        new sendername[MAX_PLAYER_NAME];
                        GetPlayerName(playerid, sendername, sizeof(sendername));
                        SirenObject[VID] = CreateObject(18646, 10.0, 10.0, 10.0, 0, 0, 0);
                        AttachObjectToVehicle(SirenObject[VID], VID, -0.43, 0.0, 0.785, 0.0, 0.1, 0.0);
                        format(string, sizeof(string), "* %s puts the siren on the roof.", sendername);
                        //SendMessageAll(playerid, COLOR_GRAD2, "This vehicle already has a siren!");
				         return 1;
			}
		case 3:
			{
				if(Siren[VID] == 0)
				{
					SendClientMessage(playerid, COLOR_GRAD2, "This vehicle doesn't have a siren on it!");
					return 1;
				}
				Siren[VID] = 0;
                new sendername[MAX_PLAYER_NAME];
               	GetPlayerName(playerid, sendername, sizeof(sendername));
               	DestroyObject(SirenObject[VID]);
               	format(string, sizeof(string), "* %s takes down the siren.", sendername);
				return 1;
			}
		default:
			{
				SendClientMessage(playerid, COLOR_WHITE, "Invalid license type! /siren [type]");
				SendClientMessage(playerid, COLOR_GRAD2, "Type: 1 = Roof, 2 = Inside, 3 = Off.");
			}
		}
	}
	else SendClientMessage(playerid, COLOR_GREY, "You're not authorised to use this command.");
	return 1;
}
Hi guys when i use this command it all works but the object doesnt appearing on my car? can someone see if you can see why that is?
Reply
#2

Anyone have any ideas? the object isnt appearing i have the same problem with my roadblocks
Reply
#3

Are you actually sure that the object limit was not reached? You may want to switch to streamer and use dynamic objects if that is the issue.

There's also a "addsiren" parameter in CreateVehicle that was added in 0.3.7
Reply
#4

How to i add dynamicobject codes then? as i get an error when i use that code saying undifined?
Reply
#5

Quote:
Originally Posted by CSLangdale
Посмотреть сообщение
How to i add dynamicobject codes then? as i get an error when i use that code saying undifined?
Use streamer include and plugin, and there was a siren parameter added to 0.3.7 as Konstantinos said.
Reply
#6

yea i want it on the vehicles in the police garage which are like sultan but i want it so they can put it on and off and i have the streamer plugin in use already.
Reply
#7

I have updated my streamer and now it wont load up? explaination?
Reply
#8

Any ideas why it wont work? and it turns out i am using streamer v2.6 but if i update it then the streamer fails... and sscanf plugin is 0.3d how do i update these?
Reply
#9

Anyone with any ideas how to fix my problem?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)