03.10.2011, 16:53
(
Последний раз редактировалось Swizzzy; 03.10.2011 в 18:28.
)
Well, I've re-written my FS for more organization and sleeker design, But i'm struggerling in finding out how to despawn a vehicle that the player is inside with a certain command, E.G. /vehdespawn
Also a command to despawn all the vehicles in the server.
If anyone could post a code or function it'll be hugely appreciable
Add my MSN: screwedup1988@live.co.uk - to Speak with me about the payment
CODE
Also a command to despawn all the vehicles in the server.
If anyone could post a code or function it'll be hugely appreciable
Add my MSN: screwedup1988@live.co.uk - to Speak with me about the payment
CODE
pawn Код:
#include <a_samp>
#include <ZCMD>
#define FILTERSCRIPT
// - DIALOG Defines
#define DIALOG_VEHMAINMENU 1000
#define DIALOG_BIKES 1001
#define DIALOG_SPORTSVEH 1002
#define DIALOG_NORMVEH 1003
#define DIALOG_CONVEH 1004
// - Colors
#define COLOR_BRIGHTRED 0xFF000AAA
#define COLOR_AQUA 0x00FFFFAA
#define COLOR_GREY 0xAFAFAFAA
#define COLOR_BEIGE 0xFFF8DCAA
#define COLOR_BLACK 0x000000AA
#define COLOR_BLUE 0x0000FFAA
#define COLOR_BLUELIGHTER 0x00BFFFAA
#define COLOR_BLUELIGHT 0x1E90FFAA
#define COLOR_BLUEMEDIUM 0x0000CDAA
#define COLOR_BLUEDARK 0x00008BAA
#define COLOR_PINK 0xFF1493AA
#define COLOR_PINKDARK 0xFF00FFAA
#define COLOR_GREEN 0x008000AA
#define COLOR_GREENLIGHT 0x00FF00AA
#define COLOR_GREENDARK 0x006400AA
#define COLOR_MAROON 0x800000AA
#define COLOR_OKER 0x808000AA
#define COLOR_ORANGE 0xFF4500AA
#define COLOR_ORANGELIGHT 0xFF8C00AA
#define COLOR_PURPLE 0x800080AA
#define COLOR_VIOLETDARK 0x9400D3AA
#define COLOR_INDIGO 0xAB0082AA
#define COLOR_RED 0xFF0000AA
#define COLOR_SAND 0xFFDEADAA
#define COLOR_SILVER 0xC0C0C0AA
#define COLOR_TEAL 0x008080AA
#define COLOR_WHITE 0xFFFFFFAA
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_GOLD 0xFFD700AA
#define COLOR_BROWN 0x8B4513AA
#define COLOR_BROWNLIGHT 0xA0522DAA
#define COLOR_GRAY 0xA9A9A9AA
#define COLOR_GRAYDARK 0x696969AA
#define COLOR_INVISIBLE 0xFFFFFF00
new Float:saveX[MAX_PLAYERS], Float:saveY[MAX_PLAYERS], Float:saveZ[MAX_PLAYERS];
public OnFilterScriptInit()
{
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
public OnPlayerRequestClass(playerid, classid)
{
return 1;
}
public OnPlayerConnect(playerid)
{
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
return 1;
}
public OnPlayerSpawn(playerid)
{
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
return 1;
}
public OnVehicleSpawn(vehicleid)
{
return 1;
}
public OnVehicleDeath(vehicleid, killerid)
{
return 1;
}
public OnPlayerText(playerid, text[])
{
return 1;
}
COMMAND:veh(playerid, params[])
{
if(IsPlayerAdmin(playerid))
{
ShowPlayerDialog(playerid, DIALOG_VEHMAINMENU, DIALOG_STYLE_LIST, "Vehicle Main Menu", "Bikes \nSports Vehicles \nConvertibles \nIndustrial \nLow Riders \nOff Road \nMilitary Vehicles \nSaloons \nStation Wagons \nBoats \nAirplanes", "Select", "Exit");
}
else
{
SendClientMessage(playerid, COLOR_BRIGHTRED, "You are not authorized to use this command.");
}
return 1;
}
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
return 1;
}
public OnPlayerExitVehicle(playerid, vehicleid)
{
return 1;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
return 1;
}
public OnPlayerEnterCheckpoint(playerid)
{
return 1;
}
public OnPlayerLeaveCheckpoint(playerid)
{
return 1;
}
public OnPlayerEnterRaceCheckpoint(playerid)
{
return 1;
}
public OnPlayerLeaveRaceCheckpoint(playerid)
{
return 1;
}
public OnRconCommand(cmd[])
{
return 1;
}
public OnPlayerRequestSpawn(playerid)
{
return 1;
}
public OnObjectMoved(objectid)
{
return 1;
}
public OnPlayerObjectMoved(playerid, objectid)
{
return 1;
}
public OnPlayerPickUpPickup(playerid, pickupid)
{
return 1;
}
public OnVehicleMod(playerid, vehicleid, componentid)
{
return 1;
}
public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
{
return 1;
}
public OnVehicleRespray(playerid, vehicleid, color1, color2)
{
return 1;
}
public OnPlayerSelectedMenuRow(playerid, row)
{
return 1;
}
public OnPlayerExitedMenu(playerid)
{
return 1;
}
public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
return 1;
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
return 1;
}
public OnRconLoginAttempt(ip[], password[], success)
{
return 1;
}
public OnPlayerUpdate(playerid)
{
return 1;
}
public OnPlayerStreamIn(playerid, forplayerid)
{
return 1;
}
public OnPlayerStreamOut(playerid, forplayerid)
{
return 1;
}
public OnVehicleStreamIn(vehicleid, forplayerid)
{
return 1;
}
public OnVehicleStreamOut(vehicleid, forplayerid)
{
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
//DIALOG MAIN
new Float:x, Float:y, Float:z;
if(dialogid == DIALOG_VEHMAINMENU)
{
if(response == 0) return SendClientMessage(playerid, COLOR_RED, "SERVR: You exited the the vehicle system's main menu");
switch(listitem)
{
case 0:
{
ShowPlayerDialog(playerid, DIALOG_BIKES, DIALOG_STYLE_LIST, "Vehicle Menu - Bikes", "BMX \nLow Rider Bike \nMountain Bike \nFaggio \nPizza Boy Faggio \nBF-400 \nNRG-500 \nPCJ-600 \nFCR-900 \nLSPD Bike \nFreeway \nWayfarer \nSanchez \nQuad", "Select", "Exit");//something
}
case 1:
{
ShowPlayerDialog(playerid, DIALOG_SPORTSVEH, DIALOG_STYLE_LIST, "Vehicle Menu - Sports Cars", "Alpha \nBanshee \nBlista Compact \nBuffalo \nBullet \nCheetah \nClub \nEuro \nFlash \nHotring Racer Red \nHotring Racer Blue \nHotring Racer Turqoise \nInfernus \nJester \nPheonix \nSabre \nSuper GT \nTurismo \nUranus \nZR-350", "Select", "Exit");//something
}
case 2:
{
ShowPlayerDialog(playerid, DIALOG_CONVEH, DIALOG_STYLE_LIST, "Vehicle Menu - Convertibles", "Comet \nFeltzer \nStallion \nWindsor", "Select", "Exit");//soemthing here
}
case 3:
{
//Soemthing
}
case 4:
{
//Something
}
case 5:
{
//something
}
case 6:
{
//seomthing
}
case 7:
{
//seomthing
}
case 8:
{
//seomthing
}
case 9:
{
//something
}
case 10:
{
//seomthing
}
}
}
//Dialog - Bikes//global variable
if(dialogid == DIALOG_BIKES)
{
if(response == 0) return SendClientMessage(playerid, COLOR_RED, "SERVR: You exited the the Vehicle - Bikes main menu");
switch(listitem)
{
case 0:
{
SendClientMessage(playerid, 0x1BE067FF, "[INFO]: You have spawned a BMX");
GetPlayerPos(playerid,x,y,z);
CreateVehicle(481,x-3.0,y,z,0.0,1,1,300);
}
case 1:
{
SendClientMessage(playerid, 0x1BE067FF, "[INFO]: You have spawned a Low Rider Bike");
GetPlayerPos(playerid,x,y,z);
CreateVehicle(509,x-3.0,y,z,0.0,1,1,300);//something
}
case 2:
{
SendClientMessage(playerid, 0x1BE067FF, "[INFO]: You have spawned a Mountain Bike");
GetPlayerPos(playerid,x,y,z);
CreateVehicle(510,x-3.0,y,z,0.0,1,1,300);//soemthing here
}
case 3:
{
SendClientMessage(playerid, 0x1BE067FF, "[INFO]: You have spawned a Faggio");
GetPlayerPos(playerid,x,y,z);
CreateVehicle(462,x-3.0,y,z,0.0,1,1,300);//soemthing here
}
case 4:
{
SendClientMessage(playerid, 0x1BE067FF, "[INFO]: You have spawned a Pizza boy Faggio");
GetPlayerPos(playerid,x,y,z);
CreateVehicle(448,x-3.0,y,z,0.0,1,1,300);//soemthing here
}
case 5:
{
SendClientMessage(playerid, 0x1BE067FF, "[INFO]: You have spawned a BF-400");
GetPlayerPos(playerid,x,y,z);
CreateVehicle(581,x-3.0,y,z,0.0,1,1,300);//soemthing here//seomthing
}
case 6:
{
SendClientMessage(playerid, 0x1BE067FF, "[INFO]: You have spawned a NRG-500");
GetPlayerPos(playerid,x,y,z);
CreateVehicle(522,x-3.0,y,z,0.0,1,1,300);//soemthing here//seomthing
}
case 7:
{
SendClientMessage(playerid, 0x1BE067FF, "[INFO]: You have spawned a PCJ-600");
GetPlayerPos(playerid,x,y,z);
CreateVehicle(461,x-3.0,y,z,0.0,1,1,300);//soemthing here//seomthing
}
case 8:
{
SendClientMessage(playerid, 0x1BE067FF, "[INFO]: You have spawned a FCR-900");
GetPlayerPos(playerid,x,y,z);
CreateVehicle(521,x-3.0,y,z,0.0,1,1,300);//soemthing here//something
}
case 9:
{
SendClientMessage(playerid, 0x1BE067FF, "[INFO]: You have spawned a LSPD Bike");
GetPlayerPos(playerid,x,y,z);
CreateVehicle(523,x-3.0,y,z,0.0,1,1,300);//soemthing here//something
}
case 10:
{
SendClientMessage(playerid, 0x1BE067FF, "[INFO]: You have spawned a Freeway");
GetPlayerPos(playerid,x,y,z);
CreateVehicle(463,x-3.0,y,z,0.0,1,1,300);//soemthing here//seomehing here
}
case 11:
{
SendClientMessage(playerid, 0x1BE067FF, "[INFO]: You have spawned a WayFarer");
GetPlayerPos(playerid,x,y,z);
CreateVehicle(586,x-3.0,y,z,0.0,1,1,300);//soemthing here//seomthing
}
case 12:
{
SendClientMessage(playerid, 0x1BE067FF, "[INFO]: You have spawned a Sanchez");
GetPlayerPos(playerid,x,y,z);
CreateVehicle(468,x-3.0,y,z,0.0,1,1,300);//soemthing here//seomthing here
}
case 13:
{
SendClientMessage(playerid, 0x1BE067FF, "[INFO]: You have spawned a Quad");
GetPlayerPos(playerid,x,y,z);
CreateVehicle(471,x-3.0,y,z,0.0,1,1,300);//soemthing here//seomthing here//seomthing here
}
}
}
//Dialog - Sports Cars
if(dialogid == DIALOG_SPORTSVEH)
{
if(response == 0) return SendClientMessage(playerid, COLOR_RED, "SERVR: You exited the the Vehicle - Sports car menu");
switch(listitem)
{
case 0:
{
SendClientMessage(playerid, 0x1BE067FF, "[INFO]: You have spawned a Alpha");
GetPlayerPos(playerid,x,y,z);
CreateVehicle(602,x-3.0,y,z,0.0,1,1,300);
}
case 1:
{
SendClientMessage(playerid, 0x1BE067FF, "[INFO]: You have spawned a Banshee");
GetPlayerPos(playerid,x,y,z);
CreateVehicle(429,x-3.0,y,z,0.0,1,1,300);//something
}
case 2:
{
SendClientMessage(playerid, 0x1BE067FF, "[INFO]: You have spawned a Blista Compact");
GetPlayerPos(playerid,x,y,z);
CreateVehicle(496,x-3.0,y,z,0.0,1,1,300);//soemthing here
}
case 3:
{
SendClientMessage(playerid, 0x1BE067FF, "[INFO]: You have spawned a Buffalo");
GetPlayerPos(playerid,x,y,z);
CreateVehicle(409,x-3.0,y,z,0.0,1,1,300);//soemthing here
}
case 4:
{
SendClientMessage(playerid, 0x1BE067FF, "[INFO]: You have spawned a Bullet");
GetPlayerPos(playerid,x,y,z);
CreateVehicle(541,x-3.0,y,z,0.0,1,1,300);//soemthing here
}
case 5:
{
SendClientMessage(playerid, 0x1BE067FF, "[INFO]: You have spawned a Cheetah");
GetPlayerPos(playerid,x,y,z);
CreateVehicle(415,x-3.0,y,z,0.0,1,1,300);//soemthing here//seomthing
}
case 6:
{
SendClientMessage(playerid, 0x1BE067FF, "[INFO]: You have spawned a Club");
GetPlayerPos(playerid,x,y,z);
CreateVehicle(589,x-3.0,y,z,0.0,1,1,300);//soemthing here//seomthing
}
case 7:
{
SendClientMessage(playerid, 0x1BE067FF, "[INFO]: You have spawned a Euro");
GetPlayerPos(playerid,x,y,z);
CreateVehicle(587,x-3.0,y,z,0.0,1,1,300);//soemthing here//seomthing
}
case 8:
{
SendClientMessage(playerid, 0x1BE067FF, "[INFO]: You have spawned a Flash");
GetPlayerPos(playerid,x,y,z);
CreateVehicle(565,x-3.0,y,z,0.0,1,1,300);//soemthing here//something
}
case 9:
{
SendClientMessage(playerid, 0x1BE067FF, "[INFO]: You have spawned a Hotring Racer Red");
GetPlayerPos(playerid,x,y,z);
CreateVehicle(494,x-3.0,y,z,0.0,1,1,300);//soemthing here//something
}
case 10:
{
SendClientMessage(playerid, 0x1BE067FF, "[INFO]: You have spawned a Hotring Racer Blue");
GetPlayerPos(playerid,x,y,z);
CreateVehicle(502,x-3.0,y,z,0.0,1,1,300);//soemthing here//seomehing here
}
case 11:
{
SendClientMessage(playerid, 0x1BE067FF, "[INFO]: You have spawned a Hotring Racer Turqoise");
GetPlayerPos(playerid,x,y,z);
CreateVehicle(503,x-3.0,y,z,0.0,1,1,300);//soemthing here//seomthing
}
case 12:
{
SendClientMessage(playerid, 0x1BE067FF, "[INFO]: You have spawned a Infernus");
GetPlayerPos(playerid,x,y,z);
CreateVehicle(511,x-3.0,y,z,0.0,1,1,300);//soemthing here//seomthing here
}
case 13:
{
SendClientMessage(playerid, 0x1BE067FF, "[INFO]: You have spawned a Jester");
GetPlayerPos(playerid,x,y,z);
CreateVehicle(559,x-3.0,y,z,0.0,1,1,300);//soemthing here//seomthing here//seomthing here
}
case 14:
{
SendClientMessage(playerid, 0x1BE067FF, "[INFO]: You have spawned a Pheonix");
GetPlayerPos(playerid,x,y,z);
CreateVehicle(603,x-3.0,y,z,0.0,1,1,300);//soemthing here//seomthing here//seomthing here
}
case 15:
{
SendClientMessage(playerid, 0x1BE067FF, "[INFO]: You have spawned a Sabre");
GetPlayerPos(playerid,x,y,z);
CreateVehicle(475,x-3.0,y,z,0.0,1,1,300);//soemthing here//seomthing here//seomthing here
}
case 16:
{
SendClientMessage(playerid, 0x1BE067FF, "[INFO]: You have spawned a Super GT");
GetPlayerPos(playerid,x,y,z);
CreateVehicle(506,x-3.0,y,z,0.0,1,1,300);//soemthing here//seomthing here//seomthing here
}
case 17:
{
SendClientMessage(playerid, 0x1BE067FF, "[INFO]: You have spawned a Turismo");
GetPlayerPos(playerid,x,y,z);
CreateVehicle(451,x-3.0,y,z,0.0,1,1,300);//soemthing here//seomthing here//seomthing here
}
case 18:
{
SendClientMessage(playerid, 0x1BE067FF, "[INFO]: You have spawned a Uranus");
GetPlayerPos(playerid,x,y,z);
CreateVehicle(558,x-3.0,y,z,0.0,1,1,300);//soemthing here//seomthing here//seomthing here
}
case 19:
{
SendClientMessage(playerid, 0x1BE067FF, "[INFO]: You have spawned a ZR-350");
GetPlayerPos(playerid,x,y,z);
CreateVehicle(477,x-3.0,y,z,0.0,1,1,300);//soemthing here//seomthing here//seomthing here
}
}
}
//Vehicles - Dialog - Convertibles
if(dialogid == DIALOG_CONVEH)
{
if(response == 0) return SendClientMessage(playerid, COLOR_RED, "SERVR: You exited the the Vehicle - Convertibles");
switch(listitem)
{
case 0:
{
SendClientMessage(playerid, 0x1BE067FF, "[INFO]: You have spawned a Comet");
GetPlayerPos(playerid,x,y,z);
CreateVehicle(480,x-3.0,y,z,0.0,1,1,300);
}
case 1:
{
SendClientMessage(playerid, 0x1BE067FF, "[INFO]: You have spawned a Feltzer");
GetPlayerPos(playerid,x,y,z);
CreateVehicle(533,x-3.0,y,z,0.0,1,1,300);//something
}
case 2:
{
SendClientMessage(playerid, 0x1BE067FF, "[INFO]: You have spawned a Stallion");
GetPlayerPos(playerid,x,y,z);
CreateVehicle(439,x-3.0,y,z,0.0,1,1,300);//soemthing here
}
case 3:
{
SendClientMessage(playerid, 0x1BE067FF, "[INFO]: You have spawned a Windsor");
GetPlayerPos(playerid,x,y,z);
CreateVehicle(555,x-3.0,y,z,0.0,1,1,300);//soemthing here
}
}
}
return 1;
}