03.06.2012, 18:46
Que tal asi? Pruebalo y me dices...
pawn Код:
if(strcmp(cmd, "/reparara", true) == 0)
{
if(IsAtMecanicosx(playerid))
{
if(PlayerInfo[playerid][pLeader] == 10 || PlayerInfo[playerid][pMember] == 10 || PlayerInfo[playerid][pLeader] == 26 || PlayerInfo[playerid][pMember] == 26)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "Utiliza: /Reparara [ID o Nombre] [Precio]");
return 1;
}
new playa;
new money;
playa = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
money = strval(tmp);
if(money < 50 || money > 30000) { SendClientMessage(playerid, COLOR_GREY, " Precio: 50 Dolar ~ 30000 Dolares"); return 1; }
if(IsPlayerConnected(playa))
{
if(ProxDetectorS(8.0, playerid, playa)&& IsPlayerInAnyVehicle(playa))
{
if(playa == playerid) { SendClientMessage(playerid, COLOR_GREY, "No Puedes Realizar Esta Acciуn!"); return 1; }
GetPlayerName(playa, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* Ofreciste a: %s para Arreglar el Coche, Por: $%d .",giveplayer,money);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* Mecanico: %s Te Ofrece Reparacion Por: $%d, (Escribe /Aceptar Reparacion)",sendername,money);
SendClientMessage(playa, COLOR_LIGHTBLUE, string);
RepairOffer[playa] = playerid;
RepairPrice[playa] = money;
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Jugador No Estб Cerca o No Estб en un Coche");
}
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "Jugador Desconectado");
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "No eres mecбcnico!");
}
return 1;
}