shape1
shape2
shape3
shape4
shape7
shape8

Прошу о помощи

Статус
Закрыто для дальнейших ответов.

Nest

Новичок
Пользователь
24.10.2014
43
4
0
Здравствуйте у меня возникла проблема не как не могу это сделать.

Пытаюсь удалить спидометр.Спидометр прописан в моде

Помогите его удалить.

Спасибо за ранее.

Мой skype:artem983111

 
A

Amfy

Гость
Гость
И как ты хочешь чтобы тебе помогли? 

P.S Перенесено в "Вопросы по скриптингу".

 

Krutihine

Участник
Пользователь
10.07.2014
546
187
0
Скриптер
Здравствуйте у меня возникла проблема не как не могу это сделать.

Пытаюсь удалить спидометр.Спидометр прописан в моде

Помогите его удалить.

Спасибо за ранее.

Мой skype:artem983111
Могу скинуть спидометр в виде FS. По аналогии удаляй.

 

Nest

Новичок
Пользователь
24.10.2014
43
4
0
Добавь в скайп скинешь спидометр

 

Krutihine

Участник
Пользователь
10.07.2014
546
187
0
Скриптер
 
Добавь в скайп скинешь спидометр

Вот код! Примерно как выглядит. Сократил количество текстдравов, криво сократил

#define MAX_ZONE_NAME 28
#define void%0(%1) forward%0(%1); public%0(%1)
new Text:Textdraw[21][MAX_PLAYERS];
new Text:textdraw6[MAX_PLAYERS];
new Text:textdraw7[MAX_PLAYERS];
new Text:textdraw8[MAX_PLAYERS];
new Text:textdraw9[MAX_PLAYERS];
new Text:textdraw10[MAX_PLAYERS];
new Text:textdraw11[MAX_PLAYERS];
new Text:textdraw12[MAX_PLAYERS];
new Text:textdraw13[MAX_PLAYERS];
new Text:textdraw14[MAX_PLAYERS];
new Text:textdraw15[MAX_PLAYERS];
new Float:probeg[MAX_VEHICLES] = 0.0;
new ProbegVeh[MAX_VEHICLES]=0;
new VehicleFuel[MAX_VEHICLES];
new bool:Engine[MAX_VEHICLES+1];
new engine,lights,alarm,doors,bonnet,boot,objective;
enum SAZONE_MAIN { //Betamaster
SAZONE_NAME[28],
Float:SAZONE_AREA[6]
};
static const gSAZones[][sAZONE_MAIN] = { // Majority of names and area coordinates adopted from Mabako's 'Zones Script' v0.2
// NAME AREA (Xmin,Ymin,Zmin,Xmax,Ymax,Zmax)
{"Whetstone", {-2997.40,-2892.90,-242.90,-1213.90,-1115.50,900.00}}
};
public OnFilterScriptInit()
{
SetTimer("FuelUpdate",10000,1);// отнимаем кол-во бензина
SetTimer("SpeedoUpdate",100,1);// обновляем спидометр раз в секунду
SetTimer("ToProbeg", 1000, 1);//прибавляем пробег
for(new i = 1;i VehicleFuel = 100;
Engine = false;
public OnFilterScriptExit()
{
return 1;
}
public OnPlayerConnect(playerid)
{
textdraw15[playerid] = TextDrawCreate(522.500000, 380.812500, "usebox");
TextDrawLetterSize(textdraw15[playerid], 0.000000, 0.655555);
TextDrawTextSize(textdraw15[playerid], 515.500000, 0.000000);
TextDrawAlignment(textdraw15[playerid], 1);
TextDrawColor(textdraw15[playerid], 0);
TextDrawUseBox(textdraw15[playerid], true);
TextDrawBoxColor(textdraw15[playerid], 0x00FFFFFF);
TextDrawSetShadow(textdraw15[playerid], 0);
TextDrawSetOutline(textdraw15[playerid], 7);
TextDrawFont(textdraw15[playerid], 0);
return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
TextDrawDestroy(Textdraw[0][playerid]); TextDrawDestroy(Textdraw[1][playerid]); TextDrawDestroy(Textdraw[2][playerid]);
TextDrawDestroy(Textdraw[3][playerid]); TextDrawDestroy(Textdraw[4][playerid]); TextDrawDestroy(Textdraw[5][playerid]);
TextDrawDestroy(Textdraw[6][playerid]); TextDrawDestroy(Textdraw[7][playerid]); TextDrawDestroy(Textdraw[8][playerid]);
TextDrawDestroy(Textdraw[9][playerid]); TextDrawDestroy(Textdraw[10][playerid]); TextDrawDestroy(Textdraw[11][playerid]);
TextDrawDestroy(Textdraw[12][playerid]); TextDrawDestroy(Textdraw[13][playerid]); TextDrawDestroy(Textdraw[14][playerid]);
TextDrawDestroy(Textdraw[15][playerid]); TextDrawDestroy(Textdraw[16][playerid]); TextDrawDestroy(Textdraw[17][playerid]);
TextDrawDestroy(Textdraw[18][playerid]); TextDrawDestroy(Textdraw[19][playerid]); TextDrawDestroy(Textdraw[20][playerid]);
TextDrawDestroy(textdraw6[playerid]); TextDrawDestroy(textdraw7[playerid]); TextDrawDestroy(textdraw8[playerid]);
TextDrawDestroy(textdraw9[playerid]); TextDrawDestroy(textdraw10[playerid]); TextDrawDestroy(textdraw11[playerid]);
TextDrawDestroy(textdraw12[playerid]); TextDrawDestroy(textdraw13[playerid]); TextDrawDestroy(textdraw14[playerid]); TextDrawDestroy(textdraw15[playerid]);
return 1;
}
public OnVehicleSpawn(vehicleid)
{
VehicleFuel[vehicleid] = 100;
Engine[vehicleid] = false;
return 1;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_DRIVER)
{
new veh = GetPlayerVehicleID(playerid);
if(IsVelo(veh))
{
GetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(veh,true,lights,alarm,doors,bonnet,boot,objective);
}
}
if(oldstate == PLAYER_STATE_DRIVER)
{
new veh = GetPlayerVehicleID(playerid);
if(IsVelo(veh))
{
GetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(veh,false,lights,alarm,doors,bonnet,boot,objective);
}
}
return true;
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)// если игрок в машние
{
if(newkeys == KEY_ACTION)// если игрок нажал на цифру "2"
{
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
new veh = GetPlayerVehicleID(playerid);
if(!IsVelo(veh))
{
if(Engine[veh] == false) {
GetVehicleParamsEx(GetPlayerVehicleID(playerid),engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(GetPlayerVehicleID(playerid) ,VEHICLE_PARAMS_ON,VEHICLE_PARAMS_ON,alarm,doors,bonnet,boot,objective);
Engine[veh] = true;
}
else {
GetVehicleParamsEx(GetPlayerVehicleID(playerid),engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(GetPlayerVehicleID(playerid),VEHICLE_PARAMS_OFF,VEHICLE_PARAMS_OFF,alarm,doors,bonnet,boot,objective);
Engine[veh] = false;
}
}
}
}
}
return 1;
}
void ToProbeg(playerid)
{
new string[144];
if(!IsPlayerInAnyVehicle(playerid)) return 1;
new Float:sp = SpeedVehicle(playerid);
new Float:l = (sp/2)/1000;
TextDrawShowForPlayer(playerid,Textdraw[2][playerid]);
Probeg[GetPlayerVehicleID(playerid)] += l;
ProbegVeh[GetPlayerVehicleID(playerid)] = floatround(Probeg[GetPlayerVehicleID(playerid)]);
format(string,sizeof(string),"%07d",ProbegVeh[GetPlayerVehicleID(playerid)]);
TextDrawSetString(Textdraw[2][playerid],string);
return 1;
}
void SpeedoUpdate()
{
foreach(Player,i)
{
if(IsPlayerConnected(i) && IsPlayerInAnyVehicle(i))
{
/*format(string,sizeof(string),"%s ( id %d )",VehicleName[GetVehicleModel(GetPlayerVehicleID(i))-400], GetPlayerVehicleID(i));
TextDrawSetString(Model,string);*/
new string[50],status[32],vehicleid = GetPlayerVehicleID(i),zones[MAX_ZONE_NAME];
GetPlayer2DZone(i, zones, MAX_ZONE_NAME);
if(Engine[GetPlayerVehicleID(i)] == true) status = "E";
else status = "~r~E";
TextDrawShowForPlayer(i,Textdraw[0]); TextDrawShowForPlayer(i,Textdraw[1]); TextDrawShowForPlayer(i,Textdraw[3]);
TextDrawShowForPlayer(i,Textdraw[4]); TextDrawShowForPlayer(i,Textdraw[5]); TextDrawShowForPlayer(i,Textdraw[6]);
TextDrawShowForPlayer(i,Textdraw[7]); TextDrawShowForPlayer(i,Textdraw[8]); TextDrawShowForPlayer(i,Textdraw[9]);
TextDrawShowForPlayer(i,Textdraw[10]); TextDrawShowForPlayer(i,Textdraw[11]); TextDrawShowForPlayer(i,Textdraw[12]);
TextDrawShowForPlayer(i,Textdraw[13]); TextDrawShowForPlayer(i,Textdraw[14]); TextDrawShowForPlayer(i,Textdraw[15]);
TextDrawShowForPlayer(i,Textdraw[16]); TextDrawShowForPlayer(i,Textdraw[17]); TextDrawShowForPlayer(i,Textdraw[18]);
TextDrawShowForPlayer(i,Textdraw[19]); TextDrawShowForPlayer(i,Textdraw[20]);
format(string,sizeof(string),"%d km/h",SpeedVehicle(i));
TextDrawSetString(Textdraw[1],string);
format(string,sizeof(string),"%d",VehicleFuel[vehicleid]);
TextDrawSetString(Textdraw[7],string);
format(string,sizeof(string),"%s",status);
TextDrawSetString(Textdraw[4],string);
format(string,sizeof(string),"%s",zones);
TextDrawSetString(Textdraw[9],string);
if(SpeedVehicle(i) > 20) TextDrawShowForPlayer(i,textdraw6);
else TextDrawHideForPlayer(i,textdraw6);
if(SpeedVehicle(i) > 40) TextDrawShowForPlayer(i,textdraw7);
else TextDrawHideForPlayer(i,textdraw7);
if(SpeedVehicle(i) > 60) TextDrawShowForPlayer(i,textdraw8);
else TextDrawHideForPlayer(i,textdraw8);
if(SpeedVehicle(i) > 80) TextDrawShowForPlayer(i,textdraw9);
else TextDrawHideForPlayer(i,textdraw9);
if(SpeedVehicle(i) > 100) TextDrawShowForPlayer(i,textdraw10);
else TextDrawHideForPlayer(i,textdraw10);
if(SpeedVehicle(i) > 120) TextDrawShowForPlayer(i,textdraw11);
else TextDrawHideForPlayer(i,textdraw11);
if(SpeedVehicle(i) > 140) TextDrawShowForPlayer(i,textdraw12);
else TextDrawHideForPlayer(i,textdraw12);
if(SpeedVehicle(i) > 160) TextDrawShowForPlayer(i,textdraw13);
else TextDrawHideForPlayer(i,textdraw13);
if(SpeedVehicle(i) > 180) TextDrawShowForPlayer(i,textdraw14);
else TextDrawHideForPlayer(i,textdraw14);
if(SpeedVehicle(i) > 200) TextDrawShowForPlayer(i,textdraw15);
else TextDrawHideForPlayer(i,textdraw15);
}

if(!IsPlayerInAnyVehicle(i))
{
TextDrawHideForPlayer(i,Textdraw[0]); TextDrawHideForPlayer(i,Textdraw[1]); TextDrawHideForPlayer(i,Textdraw[2]);
TextDrawHideForPlayer(i,Textdraw[3]); TextDrawHideForPlayer(i,Textdraw[4]); TextDrawHideForPlayer(i,Textdraw[5]);
TextDrawHideForPlayer(i,Textdraw[6]); TextDrawHideForPlayer(i,Textdraw[7]); TextDrawHideForPlayer(i,Textdraw[8]);
TextDrawHideForPlayer(i,Textdraw[9]); TextDrawHideForPlayer(i,Textdraw[10]); TextDrawHideForPlayer(i,Textdraw[11]);
TextDrawHideForPlayer(i,Textdraw[12]); TextDrawHideForPlayer(i,Textdraw[13]); TextDrawHideForPlayer(i,Textdraw[14]);
TextDrawHideForPlayer(i,Textdraw[15]); TextDrawHideForPlayer(i,Textdraw[16]); TextDrawHideForPlayer(i,Textdraw[17]);
TextDrawHideForPlayer(i,Textdraw[18]); TextDrawHideForPlayer(i,Textdraw[19]); TextDrawHideForPlayer(i,Textdraw[20]);
TextDrawHideForPlayer(i,textdraw6); TextDrawHideForPlayer(i,textdraw7); TextDrawHideForPlayer(i,textdraw8);
TextDrawHideForPlayer(i,textdraw9); TextDrawHideForPlayer(i,textdraw10); TextDrawHideForPlayer(i,textdraw11);
TextDrawHideForPlayer(i,textdraw12); TextDrawHideForPlayer(i,textdraw13); TextDrawHideForPlayer(i,textdraw14); TextDrawHideForPlayer(i,textdraw15);
}
}
}
void FuelUpdate()
{
for(new i = 1;i if(GetVehicleModel(i)) {
GetVehicleParamsEx(i,engine,lights,alarm,doors,bonnet,boot,objective);
if(Engine == true) {
if(VehicleFuel > 0) VehicleFuel--;
else SetVehicleParamsEx(i,0,lights,alarm,doors,bonnet,boot,objective);
}
}
}
}
stock IsVelo(veh)
{
switch(GetVehicleModel(veh)) {
case 481,509,510: return 1;
}
return 0;
}
stock SpeedVehicle(playerid, bool:return_km=true)//by Frog163
{
new Float:x, Float:y, Float:z;
if(IsPlayerInAnyVehicle(playerid)) {
new veh = GetPlayerVehicleID(playerid);
GetVehicleVelocity(veh, x, y, z);
}else GetPlayerVelocity(playerid, x, y, z);
return return_km?floatround(floatsqroot(x*x+y*y+z*z)*195):floatround(floatsqroot(x*x+y*y+z*z)*121);
}
stock GetPlayer2DZone(playerid, zone[], len) //Credits to Cueball, Betamaster, Mabako, and Simon (for finetuning).
{
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
for(new i = 0; i != sizeof(gSAZones); i++ )
{
if(x >= gSAZones[sAZONE_AREA][0] && x <= gSAZones[sAZONE_AREA][3] && y >= gSAZones[sAZONE_AREA][1] && y <= gSAZones[sAZONE_AREA][4])
{
format(zone, len, gSAZones[sAZONE_NAME], 0);
return i;

}
}
return 0;
}

;i++)>;i++)>
 
Последнее редактирование модератором:
Статус
Закрыто для дальнейших ответов.