18.12.2010, 11:58
pawn Код:
#include <a_samp>
/*\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
/*\\\\\\\\\\\Script made by Geso\\\\\\\\\\\*/
/*http://forum.sa-mp.com/member.php?u=76396*/
/*\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
#define COLOR_GREEN 0x33AA33AA
#define COLOR_RED 0xAA3333AA
new IsSpu[MAX_VEHICLES] = 0;
new Lamp[MAX_VEHICLES] = 0;
new light[MAX_VEHICLES];
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" SPU's [Special Police Units] by Geso ");
print("--------------------------------------\n");
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/spu", cmdtext, true, 10) == 0)
{
ShowPlayerDialog(playerid, 112, DIALOG_STYLE_LIST, "So you want to have a SPU, what one do you want then?", "Sultan [dashboard]\nSultan [roof]\nCheetah [dashboard]\nCheetah [roof]\nWashington [dashboard]\nWashington [roof]\nPremier [dashboard]\nPremier [roof]", "Take it", "Leave it" );
return 1;
}
return 0;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(response == 1 && dialogid == 112)
{
switch(listitem)
{
// We'll use the switch/cases now because we're going to process a few results, not just one. Remember, the first item in the list has id 0.
case 0:
{//sultan lamp inside
new Float:x, Float:y, Float:z, Float:angle;
GetPlayerPos(playerid, x, y, z);
GetPlayerFacingAngle(playerid, angle);
new vehicleid=CreateVehicle(560, x, y, z, angle, 0, 0, -1);
PutPlayerInVehicle(playerid, vehicleid, 0);
SetVehicleVirtualWorld(vehicleid, GetPlayerVirtualWorld(playerid));
LinkVehicleToInterior(vehicleid, GetPlayerInterior(playerid));
IsSpu[vehicleid] = 1;
Lamp[vehicleid] = 1;
light[vehicleid] = CreateObject(18646,x, y, z, 0.0, 0.0, 96.0);
AttachObjectToVehicle(light[vehicleid], vehicleid, 0.398071289, 0.75390625, 0.43879509, 0.0, 0.0, 0.0);
}
case 1:
{//sultan lamp outside
new Float:x, Float:y, Float:z, Float:angle;
GetPlayerPos(playerid, x, y, z);
GetPlayerFacingAngle(playerid, angle);
new vehicleid=CreateVehicle(560, x, y, z, angle, 0, 0, -1);
PutPlayerInVehicle(playerid, vehicleid, 0);
SetVehicleVirtualWorld(vehicleid, GetPlayerVirtualWorld(playerid));
LinkVehicleToInterior(vehicleid, GetPlayerInterior(playerid));
IsSpu[vehicleid] = 2;
Lamp[vehicleid] = 1;
light[vehicleid] = CreateObject(18646,x, y, z, 0.0, 0.0, 96.0);
AttachObjectToVehicle(light[vehicleid], vehicleid, -0.35644531250, 0.0388183593, 0.863788605, 0.0, 0.0, 0.0);
}
case 2:
{//cheetah lamp inside
new Float:x, Float:y, Float:z, Float:angle;
GetPlayerPos(playerid, x, y, z);
GetPlayerFacingAngle(playerid, angle);
new vehicleid=CreateVehicle(415, x, y, z, angle, 0, 0, -1);
PutPlayerInVehicle(playerid, vehicleid, 0);
SetVehicleVirtualWorld(vehicleid, GetPlayerVirtualWorld(playerid));
LinkVehicleToInterior(vehicleid, GetPlayerInterior(playerid));
IsSpu[vehicleid] = 3;
Lamp[vehicleid] = 1;
light[vehicleid] = CreateObject(18646,x, y, z, 0.0, 0.0, 96.0);
AttachObjectToVehicle(light[vehicleid], vehicleid, 0.409729004, 0.526367188, 0.206963539, 0.0, 0.0, 0.0);
}
case 3:
{//cheetah lamp outside
new Float:x, Float:y, Float:z, Float:angle;
GetPlayerPos(playerid, x, y, z);
GetPlayerFacingAngle(playerid, angle);
new vehicleid=CreateVehicle(415, x, y, z, angle, 0, 0, -1);
PutPlayerInVehicle(playerid, vehicleid, 0);
SetVehicleVirtualWorld(vehicleid, GetPlayerVirtualWorld(playerid));
LinkVehicleToInterior(vehicleid, GetPlayerInterior(playerid));
IsSpu[vehicleid] = 4;
Lamp[vehicleid] = 1;
light[vehicleid] = CreateObject(18646,x, y, z, 0.0, 0.0, 96.0);
AttachObjectToVehicle(light[vehicleid], vehicleid, -0.290039062, -0.284179688, 0.631957054, 0.0, 0.0, 0.0);
}
case 4:
{//wash lamp inside
new Float:x, Float:y, Float:z, Float:angle;
GetPlayerPos(playerid, x, y, z);
GetPlayerFacingAngle(playerid, angle);
new vehicleid=CreateVehicle(421, x, y, z, angle, 0, 0, -1);
PutPlayerInVehicle(playerid, vehicleid, 0);
SetVehicleVirtualWorld(vehicleid, GetPlayerVirtualWorld(playerid));
LinkVehicleToInterior(vehicleid, GetPlayerInterior(playerid));
IsSpu[vehicleid] = 5;
Lamp[vehicleid] = 1;
light[vehicleid] = CreateObject(18646,x, y, z, 0.0, 0.0, 96.0);
AttachObjectToVehicle(light[vehicleid], vehicleid, 0.421691895, 0.804931641, 0.256482124, 0.0, 0.0, 0.0);
}
case 5:
{//wash lamp outside
new Float:x, Float:y, Float:z, Float:angle;
GetPlayerPos(playerid, x, y, z);
GetPlayerFacingAngle(playerid, angle);
new vehicleid=CreateVehicle(421, x, y, z, angle, 0, 0, -1);
PutPlayerInVehicle(playerid, vehicleid, 0);
SetVehicleVirtualWorld(vehicleid, GetPlayerVirtualWorld(playerid));
LinkVehicleToInterior(vehicleid, GetPlayerInterior(playerid));
IsSpu[vehicleid] = 6;
Lamp[vehicleid] = 1;
light[vehicleid] = CreateObject(18646,x, y, z, 0.0, 0.0, 96.0);
AttachObjectToVehicle(light[vehicleid], vehicleid, -0.323303223, 0.0207519532, 0.731482506, 0.0, 0.0, 0.0);
}//done
case 6:
{//premier lamp inside
new Float:x, Float:y, Float:z, Float:angle;
GetPlayerPos(playerid, x, y, z);
GetPlayerFacingAngle(playerid, angle);
new vehicleid=CreateVehicle(426, x, y, z, angle, 0, 0, -1);
PutPlayerInVehicle(playerid, vehicleid, 0);
SetVehicleVirtualWorld(vehicleid, GetPlayerVirtualWorld(playerid));
LinkVehicleToInterior(vehicleid, GetPlayerInterior(playerid));
IsSpu[vehicleid] = 7;
Lamp[vehicleid] = 1;
light[vehicleid] = CreateObject(18646,x, y, z, 0.0, 0.0, 96.0);
AttachObjectToVehicle(light[vehicleid], vehicleid, 0.575378418, 0.786132812, 0.361483574, 0.0, 0.0, 0.0);
}
case 7:
{//premier lamp outside
new Float:x, Float:y, Float:z, Float:angle;
GetPlayerPos(playerid, x, y, z);
GetPlayerFacingAngle(playerid, angle);
new vehicleid=CreateVehicle(426, x, y, z, angle, 0, 0, -1);
PutPlayerInVehicle(playerid, vehicleid, 0);
SetVehicleVirtualWorld(vehicleid, GetPlayerVirtualWorld(playerid));
LinkVehicleToInterior(vehicleid, GetPlayerInterior(playerid));
IsSpu[vehicleid] = 8;
Lamp[vehicleid] = 1;
light[vehicleid] = CreateObject(18646,x, y, z, 0.0, 0.0, 96.0);
AttachObjectToVehicle(light[vehicleid], vehicleid, -0.455505371, -0.143066406, 0.861475945, 0.0, 0.0, 0.0);
}
}
}
return 1;
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if((newkeys & KEY_SUBMISSION) && !(oldkeys & KEY_SUBMISSION))
{
VehicleLightSwitch(playerid);
}
return 1;
}
VehicleLightSwitch(playerid)
{
new vid = GetPlayerVehicleID(playerid);
if(vid == INVALID_VEHICLE_ID) return 1;
if(IsSpu[vid] == 1)
{
if(Lamp[vid] == 1)
{
DestroyObject(light[vid]);
Lamp[vid] = 0;
return 1;
}
if(Lamp[vid] == 0)
{
light[vid] = CreateObject(18646,0, 0, 0, 0.0, 0.0, 96.0);
AttachObjectToVehicle(light[vid], vid, 0.398071289, 0.75390625, 0.43879509, 0.0, 0.0, 0.0);
Lamp[vid] = 1;
return 1;
}
}
if(IsSpu[vid] == 2)
{
if(Lamp[vid] == 1)
{
DestroyObject(light[vid]);
Lamp[vid] = 0;
return 1;
}
if(Lamp[vid] == 0)
{
light[vid] = CreateObject(18646,0, 0, 0, 0.0, 0.0, 96.0);
AttachObjectToVehicle(light[vid], vid, -0.35644531250, 0.0388183593, 0.863788605, 0.0, 0.0, 0.0);
Lamp[vid] = 1;
return 1;
}
}
if(IsSpu[vid] == 3)
{
if(Lamp[vid] == 1)
{
DestroyObject(light[vid]);
Lamp[vid] = 0;
return 1;
}
if(Lamp[vid] == 0)
{
light[vid] = CreateObject(18646,0, 0, 0, 0.0, 0.0, 96.0);
AttachObjectToVehicle(light[vid], vid, 0.409729004, 0.526367188, 0.206963539, 0.0, 0.0, 0.0);
Lamp[vid] = 1;
return 1;
}
}
if(IsSpu[vid] == 4)
{
if(Lamp[vid] == 1)
{
DestroyObject(light[vid]);
Lamp[vid] = 0;
return 1;
}
if(Lamp[vid] == 0)
{
light[vid] = CreateObject(18646,0, 0, 0, 0.0, 0.0, 96.0);
AttachObjectToVehicle(light[vid], vid, -0.290039062, -0.284179688, 0.631957054, 0.0, 0.0, 0.0);
Lamp[vid] = 1;
return 1;
}
}
if(IsSpu[vid] == 5)
{
if(Lamp[vid] == 1)
{
DestroyObject(light[vid]);
Lamp[vid] = 0;
return 1;
}
if(Lamp[vid] == 0)
{
light[vid] = CreateObject(18646,0, 0, 0, 0.0, 0.0, 96.0);
AttachObjectToVehicle(light[vid], vid, 0.421691895, 0.804931641, 0.256482124, 0.0, 0.0, 0.0);
Lamp[vid] = 1;
return 1;
}
}
if(IsSpu[vid] == 6)
{
if(Lamp[vid] == 1)
{
DestroyObject(light[vid]);
Lamp[vid] = 0;
return 1;
}
if(Lamp[vid] == 0)
{
light[vid] = CreateObject(18646,0, 0, 0, 0.0, 0.0, 96.0);
AttachObjectToVehicle(light[vid], vid, -0.323303223, 0.0207519532, 0.731482506, 0.0, 0.0, 0.0);
Lamp[vid] = 1;
return 1;
}
}
if(IsSpu[vid] == 7)
{
if(Lamp[vid] == 1)
{
DestroyObject(light[vid]);
Lamp[vid] = 0;
return 1;
}
if(Lamp[vid] == 0)
{
light[vid] = CreateObject(18646,0, 0, 0, 0.0, 0.0, 96.0);
AttachObjectToVehicle(light[vid], vid, 0.575378418, 0.786132812, 0.361483574, 0.0, 0.0, 0.0);
Lamp[vid] = 1;
return 1;
}
}
if(IsSpu[vid] == 8)
{
if(Lamp[vid] == 1)
{
DestroyObject(light[vid]);
Lamp[vid] = 0;
return 1;
}
if(Lamp[vid] == 0)
{
light[vid] = CreateObject(18646,0, 0, 0, 0.0, 0.0, 96.0);
AttachObjectToVehicle(light[vid], vid, -0.455505371, -0.143066406, 0.861475945, 0.0, 0.0, 0.0);
Lamp[vid] = 1;
return 1;
}
}
return 1;
}
Here it is.