SA-MP Forums Archive
[Ayuda] Como convierto este comando - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Español/Spanish (https://sampforum.blast.hk/forumdisplay.php?fid=29)
+---- Thread: [Ayuda] Como convierto este comando (/showthread.php?tid=347973)



[Ayuda] Como convierto este comando - Andromedax - 03.06.2012

Hola lo que quiero hacer es modificar este comando para que se pueda usar en cualquier parte pero dice que solo se puede en el taller, la cosa es que no se como hacer esto.

ES UN COMANDO DE REPARAR PARA LA FACCIУN DE MECANICOS

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(playa != INVALID_PLAYER_ID)
{
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!");
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "No estбs en el taller!");
}
return 1;
}


Respuesta: [Ayuda] Como convierto este comando - davidxxx - 03.06.2012

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;
}



Respuesta: [Ayuda] Como convierto este comando - Andromedax - 03.06.2012

No me funciono, dice que no soy mecanico, ese if(IsAtMecanicosx es donde describe las coordenadas del comando.

public IsAtMecanicosx(playerid)
{
if(IsPlayerConnected(playerid))//puse artos 999999 para agrandar el rango para todo el mapa pero no alcanzo.
{
if(PlayerToPoint(9999999999999999999,playerid,1641 .2056,-2139.6641,13.4100))
{
return 1;
}
else if(PlayerToPoint(99999999999999999999999,playerid,-1528.1193,301.4527,53.1754))
{
return 1;
}
else if(PlayerToPoint(99999999999999999999999999999,pla yerid,613.0524,-124.2267,997.9922))
{
return 1;
}
else if(PlayerToPoint(99999999999999999999999,playerid,-1498.4117,728.2124,7.3706))
{
return 1;
}
else if(PlayerToPoint(99999999999999999999,playerid,-1502.0536,737.0365,7.3706))
{
return 1;
}
}
return 0;
}


Respuesta: [Ayuda] Como convierto este comando - davidxxx - 03.06.2012

Ok, intenta de nuevo.

pawn Код:
if(strcmp(cmd, "/reparara", true) == 0)
{
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(playa != INVALID_PLAYER_ID)
{
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;
}



Respuesta: [Ayuda] Como convierto este comando - Andromedax - 04.06.2012

Me sirvio!! gracias pero el problema esque me dice que el comando /aceptarreparacion no existe


Respuesta: [Ayuda] Como convierto este comando - davidxxx - 04.06.2012

Dejamelo ver, quiza tambien tenga algo que ver...


Respuesta: [Ayuda] Como convierto este comando - Andromedax - 04.06.2012

Код HTML:
if(strcmp(cmd, "/reparara", true) == 0)
{
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(playa != INVALID_PLAYER_ID)
{
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;
}



Re: [Ayuda] Como convierto este comando - Setorrel - 05.06.2012

Deja el /aceptarreparacion , para ver cual es el problema entre ambos.


Respuesta: [Ayuda] Como convierto este comando - Andromedax - 06.06.2012

Mire el GM y el problema es que no esta el comando de /aceptar reparacion