CMD:get(playerid, params[])
{
new item[32],Float:X,Float:Y,Float:Z,day,month,year;
getdate(day,month,year);
if(IsPlayerConnected(playerid))
if(sscanf(params, "s[50]", item)) return 1;
{
if(strcmp(item, "rep", true) == 0)
{
GetPlayerPos(Mechanic[playerid], X,Y,Z);
if(Mechanic[playerid] == INVALID_PLAYER_ID) return SendClientMessage(playerid,COLOR_RED, "[ERROR]:{f5f5dc} No one mechanic has offered repair your vehicle");
if(!IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playerid,COLOR_RED, "[ERROR]:{f5f5dc} You must be driving your vehicle to use this command");
if(Player[playerid][pCash] < MConductor[playerid]) return SendClientMessage(playerid,COLOR_RED, "[ERROR]:{f5f5dc} You do not have enough money");
if(Player[playerid][jNivel] == 1 && Player[playerid][jExperiencia] < 4) return SendClientMessage(playerid,COLOR_RED, "[ERROR]:{f5f5dc} You need, to have, at least 4 hours of play to accept a repair");
if(IsPlayerInRangeOfPoint(playerid, 4.0, X,Y,Z))
{
new pName[30],string[256],Float:angle,autoid = GetPlayerVehicleID(playerid);
GetPlayerName(Mechanic[playerid],pName,30);
GetPlayerFacingAngle(Mechanic[playerid],angle);
SetPlayerFacingAngle(Mechanic[playerid],angle+180);
LoopingAnim(Mechanic[playerid],"CAR","Fixn_Car_Loop",4.1,0,0,0,1,15000);<---From here it stops working
switch(Player[Mechanic[playerid]][pNivelPiloto])
{
case 1:
{
SetTimerEx("Reparando",15000,false,"d",autoid);
SetTimerEx("Reparando2",15000,false,"d",Mechanic[playerid]);
GameTextForPlayer(Mechanic[playerid], "REPAIRING VEHICLE", 15000, 5);
}
case 2:
{
SetTimerEx("Reparando",13000,false,"d",autoid);
SetTimerEx("Reparando2",13000,false,"d",Mechanic[playerid]);
GameTextForPlayer(Mechanic[playerid], "REPAIRING VEHICLE", 13000, 5);
}
case 3:
{
SetTimerEx("Reparando",9000,false,"d",autoid);
SetTimerEx("Reparando2",9000,false,"d",Mechanic[playerid]);
GameTextForPlayer(Mechanic[playerid], "REPAIRING VEHICLE", 9000, 5);
}
case 4:
{
SetTimerEx("Reparando",6000,false,"d",autoid);
SetTimerEx("Reparando2",6000,false,"d",Mechanic[playerid]);
GameTextForPlayer(Mechanic[playerid], "REPAIRING VEHICLE", 6000, 5);
}
case 5..100:
{
SetTimerEx("Reparando",3000,false,"d",autoid);
SetTimerEx("Reparando2",3000,false,"d",Mechanic[playerid]);
GameTextForPlayer(Mechanic[playerid], "REPAIRING VEHICLE", 3000, 5);
}
}
new repuestos = MRepuestos[Mechanic[playerid]];
LlamadaMeca[playerid] = 0;
SetPlayerColor(playerid, COLOR_WHITE);
QuitarDinero(playerid, MConductor[playerid]);
DarDinero(Mechanic[playerid], MConductor[playerid]);
Player[Mechanic[playerid]][Repuestos] -= repuestos;
Mechanic[playerid] = INVALID_PLAYER_ID;
format(string, sizeof(string), "%s begins to repair the vehicle.",pName);
ProxDetector(30.0, playerid, string, COLOR_LIGHTGREEN,COLOR_LIGHTGREEN,COLOR_LIGHTGREEN,COLOR_LIGHTGREEN,COLOR_LIGHTGREEN);
}
else return SendClientMessage(playerid,COLOR_RED, "[ERROR]:{f5f5dc} You must be near the mechanic to accept repair");
}
}
return 1;
}
public Reparando2(playerid)
{
LoopingAnim(playerid, "CARRY", "crry_prtial", 1.0, 0, 0, 0, 0, 0);
if(Player[playerid][pNivelPiloto] < 49)
{
if(Player[playerid][pVIPLevel] == 1)
{
new pago = random(3);
switch(pago)
{
case 0:
{
Player[playerid][pExpPiloto]++;
SendClientMessage(playerid,0x0080C2FF,"You have increased your experience with +1 skill point");
}
case 1:
{
Player[playerid][pExpPiloto]++;
SendClientMessage(playerid,0x0080C2FF,"You have increased your experience with +1 skill point");
}
case 2:
{
Player[playerid][pExpPiloto]+= 2;
SendClientMessage(playerid,0x0080C2FF,"You have increased your experience with +2 skill point");
}
}
}
else
{
Player[playerid][pExpPiloto]++;
SendClientMessage(playerid,0x0080C2FF,"You have increased your experience with +1 skill point");
}
}
else if(Player[playerid][pNivelPiloto] >= 49)
{
Player[playerid][pExpPiloto] = 0;
Player[playerid][pNivelPiloto]++;
SendClientMessage(playerid,-1,"Congratulations, you have increased your Mechanic Level");
}
}
public Reparando(vehicleid)
{
SetVehicleHealth(vehicleid, 1000.0);
}
CMD:get(playerid, params[])
{
new item[32],Float:X,Float:Y,Float:Z,day,month,year;
getdate(day,month,year);
if(IsPlayerConnected(playerid))
if(sscanf(params, "s[50]", item)) return 1;
{
if(strcmp(item, "rep", true) == 0)
{
GetPlayerPos(Mechanic[playerid], X,Y,Z);
if(Mechanic[playerid] == INVALID_PLAYER_ID) return SendClientMessage(playerid,COLOR_RED, "[ERROR]:{f5f5dc} No one mechanic has offered repair your vehicle");
if(!IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playerid,COLOR_RED, "[ERROR]:{f5f5dc} You must be driving your vehicle to use this command");
if(Player[playerid][pCash] < MConductor[playerid]) return SendClientMessage(playerid,COLOR_RED, "[ERROR]:{f5f5dc} You do not have enough money");
if(Player[playerid][jNivel] == 1 && Player[playerid][jExperiencia] < 4) return SendClientMessage(playerid,COLOR_RED, "[ERROR]:{f5f5dc} You need, to have, at least 4 hours of play to accept a repair");
if(IsPlayerInRangeOfPoint(playerid, 4.0, X,Y,Z))
{
new pName[30],string[256],Float:angle,autoid = GetPlayerVehicleID(playerid);
GetPlayerName(Mechanic[playerid],pName,30);
GetPlayerFacingAngle(Mechanic[playerid],angle);
SetPlayerFacingAngle(Mechanic[playerid],angle+180);
LoopingAnim(Mechanic[playerid],"CAR","Fixn_Car_Loop",4.1,0,0,0,1,15000);
printf("pNivelPiloto: %i",Player[Mechanic[playerid]][pNivelPiloto]);// I added this row
switch(Player[Mechanic[playerid]][pNivelPiloto])
{
case 1:
{
SetTimerEx("Reparando",15000,false,"d",autoid);
SetTimerEx("Reparando2",15000,false,"d",Mechanic[playerid]);
GameTextForPlayer(Mechanic[playerid], "REPAIRING VEHICLE", 15000, 5);
}
case 2:
{
SetTimerEx("Reparando",13000,false,"d",autoid);
SetTimerEx("Reparando2",13000,false,"d",Mechanic[playerid]);
GameTextForPlayer(Mechanic[playerid], "REPAIRING VEHICLE", 13000, 5);
}
case 3:
{
SetTimerEx("Reparando",9000,false,"d",autoid);
SetTimerEx("Reparando2",9000,false,"d",Mechanic[playerid]);
GameTextForPlayer(Mechanic[playerid], "REPAIRING VEHICLE", 9000, 5);
}
case 4:
{
SetTimerEx("Reparando",6000,false,"d",autoid);
SetTimerEx("Reparando2",6000,false,"d",Mechanic[playerid]);
GameTextForPlayer(Mechanic[playerid], "REPAIRING VEHICLE", 6000, 5);
}
case 5..100:
{
SetTimerEx("Reparando",3000,false,"d",autoid);
SetTimerEx("Reparando2",3000,false,"d",Mechanic[playerid]);
GameTextForPlayer(Mechanic[playerid], "REPAIRING VEHICLE", 3000, 5);
}
}
new repuestos = MRepuestos[Mechanic[playerid]];
LlamadaMeca[playerid] = 0;
SetPlayerColor(playerid, COLOR_WHITE);
QuitarDinero(playerid, MConductor[playerid]);
DarDinero(Mechanic[playerid], MConductor[playerid]);
Player[Mechanic[playerid]][Repuestos] -= repuestos;
Mechanic[playerid] = INVALID_PLAYER_ID;
format(string, sizeof(string), "%s begins to repair the vehicle.",pName);
ProxDetector(30.0, playerid, string, COLOR_LIGHTGREEN,COLOR_LIGHTGREEN,COLOR_LIGHTGREEN,COLOR_LIGHTGREEN,COLOR_LIGHTGREEN);
}
else return SendClientMessage(playerid,COLOR_RED, "[ERROR]:{f5f5dc} You must be near the mechanic to accept repair");
}
}
return 1;
}

|
pNivelPiloto, pExpPiloto, |
|
forward Reparando2(playerid); forward Reparando(vehicleid); |
|
public Reparando2(playerid) { LoopingAnim(playerid, "CARRY", "crry_prtial", 1.0, 0, 0, 0, 0, 0); if(Player[playerid][pNivelPiloto] < 49) { if(Player[playerid][pVIPLevel] == 1) { new pago = random(3); switch(pago) { case 0: { Player[playerid][pExpPiloto]++; SendClientMessage(playerid,0x0080C2FF,"You have increased your experience with +1 skill point"); } case 1: { Player[playerid][pExpPiloto]++; SendClientMessage(playerid,0x0080C2FF,"You have increased your experience with +1 skill point"); } case 2: { Player[playerid][pExpPiloto]+= 2; SendClientMessage(playerid,0x0080C2FF,"You have increased your experience with +2 skill point"); } } } else { Player[playerid][pExpPiloto]++; SendClientMessage(playerid,0x0080C2FF,"You have increased your experience with +1 skill point"); } } else if(Player[playerid][pNivelPiloto] >= 49) { Player[playerid][pExpPiloto] = 0; Player[playerid][pNivelPiloto]++; SendClientMessage(playerid,-1,"Congratulations, you have increased your Mechanic Level"); } } public Reparando(vehicleid) { SetVehicleHealth(vehicleid, 1000.0); } |



)