shape1
shape2
shape3
shape4
shape7
shape8

Проблема в подтверждением починки/заправки


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

Basis

chto tut doljno bit`!?
Пользователь
24.06.2014
824
271
0
22
В общем проблема заключается в том что механик предлагает починить авто,я пишу /accept refill либо же repair и пишет "Вы не можете сделать это"
Вот код refill

else if(strcmp(x_job,"refill",true) == 0)
{
   if(RefillOffer[playerid] < 999)
   {
       if(IsPlayerConnected(RefillOffer[playerid]))
       {
           if(GetPlayerMoney(playerid) > RefillPrice[playerid])
           {
               GetPlayerName(RefillOffer[playerid], giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
               new car = gLastCar[playerid];
               new fuel;
               PlayerInfo[RefillOffer[playerid]][pMechSkill] ++;
                            if(PlayerInfo[RefillOffer[playerid]][pMechSkill] == 50)
{ SendClientMessage(RefillOffer[playerid], COLOR_YELLOW, "* Your Car Mechanic Skill is now Level 2, you can add more Fuel to any Players Cars."); }
else if(PlayerInfo[RefillOffer[playerid]][pMechSkill] == 100)
{ SendClientMessage(RefillOffer[playerid], COLOR_YELLOW, "* Your Car Mechanic Skill is now Level 3, you can add more Fuel to any Players Cars."); }
else if(PlayerInfo[RefillOffer[playerid]][pMechSkill] == 200)
{ SendClientMessage(RefillOffer[playerid], COLOR_YELLOW, "* Your Car Mechanic Skill is now Level 4, you can add more Fuel to any Players Cars."); }
else if(PlayerInfo[RefillOffer[playerid]][pMechSkill] == 400)
{ SendClientMessage(RefillOffer[playerid], COLOR_YELLOW, "* Your Car Mechanic Skill is now Level 5, you can add more Fuel to any Players Cars."); }
new level = PlayerInfo[RefillOffer[playerid]][pMechSkill];
if(level >= 0 && level <= 50)
{ fuel = 15; }
else if(level >= 51 && level <= 100)
{ fuel = 40; }
else if(level >= 101 && level <= 200)
{ fuel = 60; }
else if(level >= 201 && level <= 400)
{ fuel = 80; }
else if(level >= 401)
{ fuel = 100; }
               format(string, sizeof(string), "* Òâîþ ìàøèíó ïî÷èíèëè ñ %d%, çà $%d ìåõàíèê %s.",fuel,RefillPrice[playerid],giveplayer);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* Òû ïî÷èíèë ìàøèíó %s ñ %d%, çà $%d.",sendername,fuel,RefillPrice[playerid]);
SendClientMessage(RefillOffer[playerid], COLOR_LIGHTBLUE, string);
PlayerInfo[RefillOffer[playerid]][pPayCheck] += RefillPrice[playerid];
GiveMoneyAntiCheat(playerid, -RefillPrice[playerid]);
if(Gas[car] < 110) { Gas[car] += fuel; }
       RefillOffer[playerid] = 999;
RefillPrice[playerid] = 0;
return 1;
           }
else
{
   SendClientMessage(playerid, COLOR_GREY, "Вы не можете сделать это !");
   return 1;
}
       }
       return 1;
   }
else
{
   SendClientMessage(playerid, COLOR_GREY, "No-one offered to Refill your Car !");
   return 1;
}
}


такая же штука и с repair
 
Последнее редактирование модератором:

Kostyaev

Магистр
Пользователь
19.07.2014
1 123
274
0
23
Попробуй так:

else if(strcmp(x_job,"refill",true) == 0)
{
if(RefillOffer[playerid] < 999)
{
if(Offlineonline(RefillOffer[playerid]))
{
if(GetMoney(playerid) > RefillPrice[playerid])
{
GetPlayerName(RefillOffer[playerid], giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
new car = gLastCar[playerid];
new fuel;
PlayerInfo[RefillOffer[playerid]][pMechSkill] ++;
SaveMyqlSelect(RefillOffer[playerid],"MechSkill",1,PlayerInfo[RefillOffer[playerid]][pMechSkill],"none",0.0);
if(PlayerInfo[RefillOffer[playerid]][pMechSkill] == 50)
{ SendClientMessage(RefillOffer[playerid], COLOR_YELLOW, "* Your Car Mechanic Skill is now Level 2, you can add more Fuel to any Players Cars."); }
else if(PlayerInfo[RefillOffer[playerid]][pMechSkill] == 100)
{ SendClientMessage(RefillOffer[playerid], COLOR_YELLOW, "* Your Car Mechanic Skill is now Level 3, you can add more Fuel to any Players Cars."); }
else if(PlayerInfo[RefillOffer[playerid]][pMechSkill] == 200)
{ SendClientMessage(RefillOffer[playerid], COLOR_YELLOW, "* Your Car Mechanic Skill is now Level 4, you can add more Fuel to any Players Cars."); }
else if(PlayerInfo[RefillOffer[playerid]][pMechSkill] == 400)
{ SendClientMessage(RefillOffer[playerid], COLOR_YELLOW, "* Your Car Mechanic Skill is now Level 5, you can add more Fuel to any Players Cars."); }
new level = PlayerInfo[RefillOffer[playerid]][pMechSkill];
if(level >= 0 && level <= 50)
{ fuel = 15; }
else if(level >= 51 && level <= 100)
{ fuel = 40; }
else if(level >= 101 && level <= 200)
{ fuel = 60; }
else if(level >= 201 && level <= 400)
{ fuel = 80; }
else if(level >= 401)
{ fuel = 100; }
format(string, sizeof(string), "* Твою машину починили с %d%, за $%d механик %s.",fuel,RefillPrice[playerid],giveplayer);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* Ты починил машину %s с %d%, за $%d.",sendername,fuel,RefillPrice[playerid]);
SendClientMessage(RefillOffer[playerid], COLOR_LIGHTBLUE, string);
PlayerInfo[RefillOffer[playerid]][pPayCheck] += RefillPrice[playerid];
SaveMyqlSelect(RefillOffer[playerid],"Paycheck",1,PlayerInfo[RefillOffer[playerid]][pPayCheck],"none",0.0);
GiveMoney(playerid, -RefillPrice[playerid],"Починка авто");
if(Gas[car] < 110) { Gas[car] += fuel; }
RefillOffer[playerid] = 999;
RefillPrice[playerid] = 0;
return 1;
}
else
{
SendClientMessage(playerid, COLOR_GREY, "Вы неможете сделать это !");
return 1;
}
}
return 1;
}
else
{
SendClientMessage(playerid, COLOR_GREY, "No-one offered to Refill your Car !");
return 1;
}
}
 



И с repair

Код:
			else if(strcmp(x_job,"repair",true) == 0)
			{
				if(RepairOffer[playerid] < 999)
				{
					if(GetMoney(playerid) > RepairPrice[playerid])
					{
						if(IsPlayerInAnyVehicle(playerid))
						{
							if(Offlineonline(RepairOffer[playerid]))
							{
								GetPlayerName(RepairOffer[playerid], giveplayer, sizeof(giveplayer));
								GetPlayerName(playerid, sendername, sizeof(sendername));
								RepairCar[playerid] = GetPlayerVehicleID(playerid);
								SetVehicleHealth(RepairCar[playerid], 1000.0);
								format(string, sizeof(string), "* You repaired your car for $%d by Car Mechanic %s.",RepairPrice[playerid],giveplayer);
								SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
								format(string, sizeof(string), "* You fixed %s's car, the $%d has been added to your PayCheck.",sendername,RepairPrice[playerid]);
								SendClientMessage(RepairOffer[playerid], COLOR_LIGHTBLUE, string);
								PlayerInfo[RepairOffer[playerid]][pMechSkill] ++;
								SaveMyqlSelect(RepairOffer[playerid],"MechSkill",1,PlayerInfo[RepairOffer[playerid]][pMechSkill],"none",0.0);
								if(PlayerInfo[RepairOffer[playerid]][pMechSkill] == 50)
								{ SendClientMessage(RepairOffer[playerid], COLOR_YELLOW, "* Your Car Mechanic Skill is now Level 2, you can add more Fuel to any Players Cars."); }
								else if(PlayerInfo[RepairOffer[playerid]][pMechSkill] == 100)
								{ SendClientMessage(RepairOffer[playerid], COLOR_YELLOW, "* Your Car Mechanic Skill is now Level 3, you can add more Fuel to any Players Cars."); }
								else if(PlayerInfo[RepairOffer[playerid]][pMechSkill] == 200)
								{ SendClientMessage(RepairOffer[playerid], COLOR_YELLOW, "* Your Car Mechanic Skill is now Level 4, you can add more Fuel to any Players Cars."); }
								else if(PlayerInfo[RepairOffer[playerid]][pMechSkill] == 400)
								{ SendClientMessage(RepairOffer[playerid], COLOR_YELLOW, "* Your Car Mechanic Skill is now Level 5, you can add more Fuel to any Players Cars."); }
								PlayerInfo[RepairOffer[playerid]][pPayCheck] += RepairPrice[playerid];
								SaveMyqlSelect(RepairOffer[playerid],"Paycheck",1,PlayerInfo[RepairOffer[playerid]][pPayCheck],"none",0.0);
								GiveMoney(playerid, -RepairPrice[playerid],"Починка авто");
								RepairOffer[playerid] = 999;
								RepairPrice[playerid] = 0;
								return 1;
							}
							return 1;
						}
						return 1;
					}
					else
					{
						SendClientMessage(playerid, COLOR_GREY, "You can't afford the Repair !");
						return 1;
					}
				}
				else
				{
					SendClientMessage(playerid, COLOR_GREY, "No-one offerd you to Repair your Car !");
					return 1;
				}
			}
			else { return 1; }
		}
		return 1;
	} 
 

Basis

chto tut doljno bit`!?
Пользователь
24.06.2014
824
271
0
22
Попробуй так:

else if(strcmp(x_job,"refill",true) == 0)
{
if(RefillOffer[playerid] < 999)
{
if(Offlineonline(RefillOffer[playerid]))
{
if(GetMoney(playerid) > RefillPrice[playerid])
{
GetPlayerName(RefillOffer[playerid], giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
new car = gLastCar[playerid];
new fuel;
PlayerInfo[RefillOffer[playerid]][pMechSkill] ++;
SaveMyqlSelect(RefillOffer[playerid],"MechSkill",1,PlayerInfo[RefillOffer[playerid]][pMechSkill],"none",0.0);
if(PlayerInfo[RefillOffer[playerid]][pMechSkill] == 50)
{ SendClientMessage(RefillOffer[playerid], COLOR_YELLOW, "* Your Car Mechanic Skill is now Level 2, you can add more Fuel to any Players Cars."); }
else if(PlayerInfo[RefillOffer[playerid]][pMechSkill] == 100)
{ SendClientMessage(RefillOffer[playerid], COLOR_YELLOW, "* Your Car Mechanic Skill is now Level 3, you can add more Fuel to any Players Cars."); }
else if(PlayerInfo[RefillOffer[playerid]][pMechSkill] == 200)
{ SendClientMessage(RefillOffer[playerid], COLOR_YELLOW, "* Your Car Mechanic Skill is now Level 4, you can add more Fuel to any Players Cars."); }
else if(PlayerInfo[RefillOffer[playerid]][pMechSkill] == 400)
{ SendClientMessage(RefillOffer[playerid], COLOR_YELLOW, "* Your Car Mechanic Skill is now Level 5, you can add more Fuel to any Players Cars."); }
new level = PlayerInfo[RefillOffer[playerid]][pMechSkill];
if(level >= 0 && level <= 50)
{ fuel = 15; }
else if(level >= 51 && level <= 100)
{ fuel = 40; }
else if(level >= 101 && level <= 200)
{ fuel = 60; }
else if(level >= 201 && level <= 400)
{ fuel = 80; }
else if(level >= 401)
{ fuel = 100; }
format(string, sizeof(string), "* Твою машину починили с %d%, за $%d механик %s.",fuel,RefillPrice[playerid],giveplayer);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* Ты починил машину %s с %d%, за $%d.",sendername,fuel,RefillPrice[playerid]);
SendClientMessage(RefillOffer[playerid], COLOR_LIGHTBLUE, string);
PlayerInfo[RefillOffer[playerid]][pPayCheck] += RefillPrice[playerid];
SaveMyqlSelect(RefillOffer[playerid],"Paycheck",1,PlayerInfo[RefillOffer[playerid]][pPayCheck],"none",0.0);
GiveMoney(playerid, -RefillPrice[playerid],"Починка авто");
if(Gas[car] < 110) { Gas[car] += fuel; }
RefillOffer[playerid] = 999;
RefillPrice[playerid] = 0;
return 1;
}
else
{
SendClientMessage(playerid, COLOR_GREY, "Вы неможете сделать это !");
return 1;
}
}
return 1;
}
else
{
SendClientMessage(playerid, COLOR_GREY, "No-one offered to Refill your Car !");
return 1;
}
}
 



И с repair

else if(strcmp(x_job,"repair",true) == 0)
{
if(RepairOffer[playerid] < 999)
{
if(GetMoney(playerid) > RepairPrice[playerid])
{
if(IsPlayerInAnyVehicle(playerid))
{
if(Offlineonline(RepairOffer[playerid]))
{
GetPlayerName(RepairOffer[playerid], giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
RepairCar[playerid] = GetPlayerVehicleID(playerid);
SetVehicleHealth(RepairCar[playerid], 1000.0);
format(string, sizeof(string), "* You repaired your car for $%d by Car Mechanic %s.",RepairPrice[playerid],giveplayer);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* You fixed %s's car, the $%d has been added to your PayCheck.",sendername,RepairPrice[playerid]);
SendClientMessage(RepairOffer[playerid], COLOR_LIGHTBLUE, string);
PlayerInfo[RepairOffer[playerid]][pMechSkill] ++;
SaveMyqlSelect(RepairOffer[playerid],"MechSkill",1,PlayerInfo[RepairOffer[playerid]][pMechSkill],"none",0.0);
if(PlayerInfo[RepairOffer[playerid]][pMechSkill] == 50)
{ SendClientMessage(RepairOffer[playerid], COLOR_YELLOW, "* Your Car Mechanic Skill is now Level 2, you can add more Fuel to any Players Cars."); }
else if(PlayerInfo[RepairOffer[playerid]][pMechSkill] == 100)
{ SendClientMessage(RepairOffer[playerid], COLOR_YELLOW, "* Your Car Mechanic Skill is now Level 3, you can add more Fuel to any Players Cars."); }
else if(PlayerInfo[RepairOffer[playerid]][pMechSkill] == 200)
{ SendClientMessage(RepairOffer[playerid], COLOR_YELLOW, "* Your Car Mechanic Skill is now Level 4, you can add more Fuel to any Players Cars."); }
else if(PlayerInfo[RepairOffer[playerid]][pMechSkill] == 400)
{ SendClientMessage(RepairOffer[playerid], COLOR_YELLOW, "* Your Car Mechanic Skill is now Level 5, you can add more Fuel to any Players Cars."); }
PlayerInfo[RepairOffer[playerid]][pPayCheck] += RepairPrice[playerid];
SaveMyqlSelect(RepairOffer[playerid],"Paycheck",1,PlayerInfo[RepairOffer[playerid]][pPayCheck],"none",0.0);
GiveMoney(playerid, -RepairPrice[playerid],"Починка авто");
RepairOffer[playerid] = 999;
RepairPrice[playerid] = 0;
return 1;
}
return 1;
}
return 1;
}
else
{
SendClientMessage(playerid, COLOR_GREY, "You can't afford the Repair !");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "No-one offerd you to Repair your Car !");
return 1;
}
}
else { return 1; }
}
return 1;
что касается refill ошибок нету,проверю позже,а что касаемо repair то pawno вылетает
 

Kostyaev

Магистр
Пользователь
19.07.2014
1 123
274
0
23
тогда вот так,попробуй:

Код:
else if(strcmp(x_job,"repair",true) == 0)
			{
				if(RepairOffer[playerid] < 999)
				{
					if(GetMoney(playerid) > RepairPrice[playerid])
					{
						if(IsPlayerInAnyVehicle(playerid))
						{
							if(Offlineonline(RepairOffer[playerid]))
							{
								GetPlayerName(RepairOffer[playerid], giveplayer, sizeof(giveplayer));
								GetPlayerName(playerid, sendername, sizeof(sendername));
								RepairCar[playerid] = GetPlayerVehicleID(playerid);
								SetVehicleHealth(RepairCar[playerid], 1000.0);
								format(string, sizeof(string), "* You repaired your car for $%d by Car Mechanic %s.",RepairPrice[playerid],giveplayer);
								SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
								format(string, sizeof(string), "* You fixed %s's car, the $%d has been added to your PayCheck.",sendername,RepairPrice[playerid]);
								SendClientMessage(RepairOffer[playerid], COLOR_LIGHTBLUE, string);
								PlayerInfo[RepairOffer[playerid]][pMechSkill] ++;
								if(PlayerInfo[RepairOffer[playerid]][pMechSkill] == 50)
								{ SendClientMessage(RepairOffer[playerid], COLOR_YELLOW, "* Your Car Mechanic Skill is now Level 2, you can add more Fuel to any Players Cars."); }
								else if(PlayerInfo[RepairOffer[playerid]][pMechSkill] == 100)
								{ SendClientMessage(RepairOffer[playerid], COLOR_YELLOW, "* Your Car Mechanic Skill is now Level 3, you can add more Fuel to any Players Cars."); }
								else if(PlayerInfo[RepairOffer[playerid]][pMechSkill] == 200)
								{ SendClientMessage(RepairOffer[playerid], COLOR_YELLOW, "* Your Car Mechanic Skill is now Level 4, you can add more Fuel to any Players Cars."); }
								else if(PlayerInfo[RepairOffer[playerid]][pMechSkill] == 400)
								{ SendClientMessage(RepairOffer[playerid], COLOR_YELLOW, "* Your Car Mechanic Skill is now Level 5, you can add more Fuel to any Players Cars."); }
								PlayerInfo[RepairOffer[playerid]][pPayCheck] += RepairPrice[playerid];
								GiveMoney(playerid, -RepairPrice[playerid]);
								RepairOffer[playerid] = 999;
								RepairPrice[playerid] = 0;
								return 1;
							}
							return 1;
						}
						return 1;
					}
					else
					{
						SendClientMessage(playerid, COLOR_GREY, "You can't afford the Repair !");
						return 1;
					}
				}
				else
				{
					SendClientMessage(playerid, COLOR_GREY, "No-one offerd you to Repair your Car !");
					return 1;
				}
			}
			else { return 1; }
		}
		return 1;
	} 
 

Basis

chto tut doljno bit`!?
Пользователь
24.06.2014
824
271
0
22
тогда вот так,попробуй:

else if(strcmp(x_job,"repair",true) == 0)
{
if(RepairOffer[playerid] < 999)
{
if(GetMoney(playerid) > RepairPrice[playerid])
{
if(IsPlayerInAnyVehicle(playerid))
{
if(Offlineonline(RepairOffer[playerid]))
{
GetPlayerName(RepairOffer[playerid], giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
RepairCar[playerid] = GetPlayerVehicleID(playerid);
SetVehicleHealth(RepairCar[playerid], 1000.0);
format(string, sizeof(string), "* You repaired your car for $%d by Car Mechanic %s.",RepairPrice[playerid],giveplayer);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* You fixed %s's car, the $%d has been added to your PayCheck.",sendername,RepairPrice[playerid]);
SendClientMessage(RepairOffer[playerid], COLOR_LIGHTBLUE, string);
PlayerInfo[RepairOffer[playerid]][pMechSkill] ++;
if(PlayerInfo[RepairOffer[playerid]][pMechSkill] == 50)
{ SendClientMessage(RepairOffer[playerid], COLOR_YELLOW, "* Your Car Mechanic Skill is now Level 2, you can add more Fuel to any Players Cars."); }
else if(PlayerInfo[RepairOffer[playerid]][pMechSkill] == 100)
{ SendClientMessage(RepairOffer[playerid], COLOR_YELLOW, "* Your Car Mechanic Skill is now Level 3, you can add more Fuel to any Players Cars."); }
else if(PlayerInfo[RepairOffer[playerid]][pMechSkill] == 200)
{ SendClientMessage(RepairOffer[playerid], COLOR_YELLOW, "* Your Car Mechanic Skill is now Level 4, you can add more Fuel to any Players Cars."); }
else if(PlayerInfo[RepairOffer[playerid]][pMechSkill] == 400)
{ SendClientMessage(RepairOffer[playerid], COLOR_YELLOW, "* Your Car Mechanic Skill is now Level 5, you can add more Fuel to any Players Cars."); }
PlayerInfo[RepairOffer[playerid]][pPayCheck] += RepairPrice[playerid];
GiveMoney(playerid, -RepairPrice[playerid]);
RepairOffer[playerid] = 999;
RepairPrice[playerid] = 0;
return 1;
}
return 1;
}
return 1;
}
else
{
SendClientMessage(playerid, COLOR_GREY, "You can't afford the Repair !");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "No-one offerd you to Repair your Car !");
return 1;
}
}
else { return 1; }
}
return 1;
все равно не отвечает пвн
 

Kostyaev

Магистр
Пользователь
19.07.2014
1 123
274
0
23
А может ошибка не с repair ?

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