02.08.2013, 20:36
I use
And works fine.
You can use this code. Or try to use [MAX_VEHICLES] instead of [MAX_PLAYERS]
pawn Код:
new Siren[MAX_VEHICLES];
new SirenObject[MAX_VEHICLES];
CMD:siren(playerid, params[])
{
new siren[65];
new VID = GetPlayerVehicleID(playerid);
new string[128];
if(strcmp(siren, "inside", true, strlen(siren)) == 0)
{
if(Siren[VID] == 0)
{
Siren[VID] = 1;
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.", GetPlayerNameEx(playerid));
SendNearbyMessage(playerid, 30, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
else
{
return SendClientMessage(playerid, COLOR_GREY, "This vehicle already has a siren!");
}
}
}
return 1;
You can use this code. Or try to use [MAX_VEHICLES] instead of [MAX_PLAYERS]