Fiz a base dele.
PHP код:
#include <a_samp>
#include <zcmd>
#define MESSAGE_SCM 0 // SendClientMessage
#define MESSAGE_GTP 1 // GameTextForPlayer
#define MESSAGE_TXD 2 // TextDrawShowForPlayer
CreateVehicle_Pos(playerid, msg_mode, msg_string[], model, Float:x, Float:y, Float:z, Float:angle, color1, color2, respawn_d);
MessageOption_GTP(allplayers, time, style);
MessageOption_SCM(allplayers, color);
new VehicleNames[212][] = {
{"Landstalker"},{"Bravura"},{"Buffalo"},{"Linerunner"},{"Perrenial"},{"Sentinel"},{"Dumper"},
{"Firetruck"},{"Trashmaster"},{"Stretch"},{"Manana"},{"Infernus"},{"Voodoo"},{"Pony"},{"Mule"},
{"Cheetah"},{"Ambulance"},{"Leviathan"},{"Moonbeam"},{"Esperanto"},{"Taxi"},{"Washington"},
{"Bobcat"},{"Mr Whoopee"},{"BF Injection"},{"Hunter"},{"Premier"},{"Enforcer"},{"Securicar"},
{"Banshee"},{"Predator"},{"Bus"},{"Rhino"},{"Barracks"},{"Hotknife"},{"Trailer 1"},{"Previon"},
{"Coach"},{"Cabbie"},{"Stallion"},{"Rumpo"},{"RC Bandit"},{"Romero"},{"Packer"},{"Monster"},
{"Admiral"},{"Squalo"},{"Seasparrow"},{"Pizzaboy"},{"Tram"},{"Trailer 2"},{"Turismo"},
{"Speeder"},{"Reefer"},{"Tropic"},{"Flatbed"},{"Yankee"},{"Caddy"},{"Solair"},{"Berkley's RC Van"},
{"Skimmer"},{"PCJ-600"},{"Faggio"},{"Freeway"},{"RC Baron"},{"RC Raider"},{"Glendale"},{"Oceanic"},
{"Sanchez"},{"Sparrow"},{"Patriot"},{"Quad"},{"Coastguard"},{"Dinghy"},{"Hermes"},{"Sabre"},
{"Rustler"},{"ZR-350"},{"Walton"},{"Regina"},{"Comet"},{"BMX"},{"Burrito"},{"Camper"},{"Marquis"},
{"Baggage"},{"Dozer"},{"Maverick"},{"News Chopper"},{"Rancher"},{"FBI Rancher"},{"Virgo"},{"Greenwood"},
{"Jetmax"},{"Hotring"},{"Sandking"},{"Blista Compact"},{"Police Maverick"},{"Boxville"},{"Benson"},
{"Mesa"},{"RC Goblin"},{"Hotring Racer A"},{"Hotring Racer B"},{"Bloodring Banger"},{"Rancher"},
{"Super GT"},{"Elegant"},{"Journey"},{"Bike"},{"Mountain Bike"},{"Beagle"},{"Cropdust"},{"Stunt"},
{"Tanker"}, {"Roadtrain"},{"Nebula"},{"Majestic"},{"Buccaneer"},{"Shamal"},{"Hydra"},{"FCR-900"},
{"NRG-500"},{"HPV1000"},{"Cement Truck"},{"Tow Truck"},{"Fortune"},{"Cadrona"},{"FBI Truck"},
{"Willard"},{"Forklift"},{"Tractor"},{"Combine"},{"Feltzer"},{"Remington"},{"Slamvan"},
{"Blade"},{"Freight"},{"Streak"},{"Vortex"},{"Vincent"},{"Bullet"},{"Clover"},{"Sadler"},
{"Firetruck LA"},{"Hustler"},{"Intruder"},{"Primo"},{"Cargobob"},{"Tampa"},{"Sunrise"},{"Merit"},
{"Utility"},{"Nevada"},{"Yosemite"},{"Windsor"},{"Monster A"},{"Monster B"},{"Uranus"},{"Jester"},
{"Sultan"},{"Stratum"},{"Elegy"},{"Raindance"},{"RC Tiger"},{"Flash"},{"Tahoma"},{"Savanna"},
{"Bandito"},{"Freight Flat"},{"Streak Carriage"},{"Kart"},{"Mower"},{"Duneride"},{"Sweeper"},
{"Broadway"},{"Tornado"},{"AT-400"},{"DFT-30"},{"Huntley"},{"Stafford"},{"BF-400"},{"Newsvan"},
{"Tug"},{"Trailer 3"},{"Emperor"},{"Wayfarer"},{"Euros"},{"Hotdog"},{"Club"},{"Freight Carriage"},
{"Trailer 3"},{"Andromada"},{"Dodo"},{"RC Cam"},{"Launch"},{"Police Car (LSPD)"},{"Police Car (SFPD)"},
{"Police Car (LVPD)"},{"Police Ranger"},{"Picador"},{"S.W.A.T. Van"},{"Alpha"},{"Phoenix"},{"Glendale"},
{"Sadler"},{"Luggage Trailer A"},{"Luggage Trailer B"},{"Stair Trailer"},{"Boxville"},{"Farm Plow"},
{"Utility Trailer"}
};
enum p_VEHICLE{
v_ID,
v_LastID,
v_Model,
Float:v_pos[4],
v_color1,
v_color2
};
enum e_MESSAGE_SCM{
_all_players,
_color
};
enum e_MESSAGE_GTP{
_all_players,
_time,
_style
};
enum e_MESSAGE_TXD{
_all_players
};
new
// Text message
PlayerText:g_ptxdMessageVehicle[MAX_PLAYERS],
Text:g_txdMessageVehicle,
g_szString[128],
// Vehicle data
p_VEH[MAX_PLAYERS][p_VEHICLE],
// Config system
msg_option_TXD[e_MESSAGE_TXD],
msg_option_GTP[e_MESSAGE_GTP],
msg_option_SCM[e_MESSAGE_SCM],
Float:velocityVeh[4]
;
public OnFilterScriptInit(){
print("\n--------------------------------------");
print(" sys_vehicles by iShock");
print("--------------------------------------\n");
MessageOption_GTP(false, 5000, 3);
MessageOption_SCM(false, 0xFFFF00FF);
return 1;
}
public OnFilterScriptExit(){return 1;}
public OnPlayerConnect(playerid){
g_ptxdMessageVehicle[playerid] = CreatePlayerTextDraw(playerid, 240.0, 580.0, "_");
g_txdMessageVehicle = TextDrawCreate(100.0, 100.0, "_");
return 1;
}
CMD:v(playerid, params[]){
new
Float:px,
Float:py,
Float:pz,
Float:pa,
string[128]
;
if (GetPlayerState(playerid) == PLAYER_STATE_DRIVER){
GetVehiclePos(GetPlayerVehicleID(playerid), px, py, pz);
GetVehicleVelocity(GetPlayerVehicleID(playerid), velocityVeh[0], velocityVeh[1], velocityVeh[2]);
GetVehicleZAngle(GetPlayerVehicleID(playerid), pa);
}
else {
GetPlayerPos(playerid, px, py, pz);
GetPlayerFacingAngle(playerid, pa);
}
format(string, sizeof(string), "Vocк criou um veнculo - Modelo:%s", GetVehicleName(strval(params)));
CreateVehicle_Pos(playerid, MESSAGE_SCM, string, strval(params), px, py, pz, pa, 0, 0, -1);
return 1;
}
CMD:getv(playerid, params[]){
return 1;
}
CMD:lastv(playerid, params[]){
// CreateLastVehicle_Pos(playerid, MESSAGE_SCM, "", x, y, z, angle);
return 1;
}
CreateVehicle_Pos(playerid, msg_mode, msg_string[], model, Float:x, Float:y, Float:z, Float:angle, color1, color2, respawn_d){
if ( 400 <= model <= 611){
if (p_VEH[playerid][v_LastID]){
RemovePlayerFromVehicle(playerid);
new i;
while( i != 75){ i++;}
DestroyVehicle(p_VEH[playerid][v_LastID]);
}
p_VEH[playerid][v_ID] = CreateVehicle(model, x, y, z, angle, color1, color2, respawn_d);
p_VEH[playerid][v_LastID] = p_VEH[playerid][v_ID];
p_VEH[playerid][v_Model] = model;
p_VEH[playerid][v_pos][0] = x;
p_VEH[playerid][v_pos][1] = y;
p_VEH[playerid][v_pos][2] = z;
p_VEH[playerid][v_pos][3] = angle;
SetVehicleVirtualWorld(p_VEH[playerid][v_ID], GetPlayerVirtualWorld(playerid));
LinkVehicleToInterior(p_VEH[playerid][v_ID], GetPlayerInterior(playerid));
PutPlayerInVehicle(playerid, p_VEH[playerid][v_ID], 0);
SetVehicleVelocity(p_VEH[playerid][v_ID], velocityVeh[0], velocityVeh[1], velocityVeh[2]);
} else {
p_VEH[playerid][v_ID] = INVALID_VEHICLE_ID;
format(g_szString, sizeof(g_szString), "Internal error - ID:%d"); //Nгo finalizado
SendClientMessage(playerid,-1, g_szString);
}
if (msg_string[0] || strlen(msg_string) > 3){
switch (msg_mode){
case MESSAGE_SCM:{
if (!msg_option_SCM[_all_players]){
SendClientMessage(playerid,-1, "Your Vehicle has been created!");
SendClientMessage(playerid, msg_option_SCM[_color], msg_string);
} else {
SendClientMessageToAll(msg_option_SCM[_color], msg_string);
}
}
case MESSAGE_GTP:{
if (!msg_option_GTP[_all_players]){
GameTextForPlayer(playerid, msg_string, msg_option_GTP[_time], msg_option_GTP[_style]);
} else{
GameTextForAll(msg_string, msg_option_GTP[_time], msg_option_GTP[_style]);
}
}
case MESSAGE_TXD: {
if (!msg_option_TXD[_all_players]){
PlayerTextDrawShow(playerid, g_ptxdMessageVehicle[playerid]);
} else{
TextDrawShowForAll( g_txdMessageVehicle);
}
}
default:{
print(msg_string);
}
}
}
return p_VEH[playerid][v_ID];
}
GetVehicleName(model){
new L_szString[35];
L_szString = "model unknown";
if(400 <= model <= 611)
strcat((L_szString[0]= '\0', L_szString), VehicleNames[model - 400]);
return L_szString;
}
MessageOption_GTP(allplayers, time, style){
msg_option_GTP[_all_players] = allplayers;
msg_option_GTP[_time] = time;
msg_option_GTP[_style] = style;
}
MessageOption_SCM(allplayers, color){
msg_option_SCM[_all_players] = allplayers;
msg_option_SCM[_color] = color;
}
//--------------------
Vai ter muitas alteraзхes em breve, isto й apenas um esboзo. O meu teclado e estrago agora estou usando teclado virtual..