CMD:vender(playerid, params[])
{
if(isnull(params))
{
SendClientMessageEx(playerid, 0x008FECFF, "Modo de uso: {FFFFFF}/vender [Item]");
if(Info[playerid][pMember] == 9 || Info[playerid][pLeader] == 9)
{
SendClientMessageEx(playerid, 0x008FECFF, "Informaciуn: {FFFFFF}pala, maza, ghumo, motosierra, extinguidor");
}
return 1;
}
if(strcmp(params, "rz", true) == 0)
{
new string[200], giveplayerid, amount, price;
if(sscanf(params, "ddd", giveplayerid, amount, price)) return SendClientMessageEx(playerid, 0x008FECFF, "Modo de uso: {FFFFFF}/vender rz [ID] [cantidad] [precio]");
if(amount < 0 || amount > 9999999)
{
SendClientMessageEx(playerid, COLOR_DIALOGO1, "ERROR: {FFFFFF}Los valores no pueden ser mayores a 9999999 monedas ni menores a 1.");
return 1;
}
if(IsPlayerConnected(playerid))
{
if(IsPlayerConnected(giveplayerid))
{
if(ProxDetectorS(8.0, playerid, giveplayerid))
{
if(giveplayerid == playerid) return SendClientMessageEx(playerid, 0x008FECFF, "Informaciуn: {FFFFFF}No puedes venderte a ti mismo.");
format(string, sizeof(string), "[Ventas] {FFFFFF}Le ofreciste {F5FF00}%s {FFFFFF}Monedas Rz a {F5FF00}%s {FFFFFF}por {00CC00}$%d", amount, GetPlayerNameEx(giveplayerid), price);
SendClientMessageEx(playerid, 0x00CC00FF, string);
format(string, sizeof(string), "%s {FFFFFF}te ofrece {F5FF00}%s {FFFFFF}Monedas Rz por {00CC00}$%d, {FFFFFF}para aceptarla usa {F5FF00}/aceptar rz", GetPlayerNameEx(playerid), amount, price);
SendClientMessageEx(giveplayerid, 0xF5FF00FF, string);
FOffer[giveplayerid] = playerid;
FPrice[giveplayerid] = price;
return FAmount[giveplayerid] = amount;
}
else return SendClientMessageEx(playerid, COLOR_DIALOGO1, "ERROR: {FFFFFF}Ese jugador estб lejos de ti.");
}
}
else SendClientMessageEx(playerid, COLOR_DIALOGO1, "ERROR: {FFFFFF}ID Invбlida.");
return 1;
}
else SendClientMessageEx(playerid, COLOR_DIALOGO1, "ERROR: {FFFFFF}Has ingresado un comando incorrecto, usa /vender [Item]");
return 1;
}
CMD:vender(playerid, params[])
{
new choice[3];
if(sscanf(params, "s[3]",choice))
{
SendClientMessageEx(playerid, 0x008FECFF, "Modo de uso: {FFFFFF}/vender [Item]");
if(Info[playerid][pMember] == 9 || Info[playerid][pLeader] == 9)
{
SendClientMessageEx(playerid, 0x008FECFF, "Informaciуn: {FFFFFF}pala, maza, ghumo, motosierra, extinguidor");
}
return 1;
}
if(!strcmp(choice, "rz", false, 2))
{
new string[200], giveplayerid, amount, price;
if(sscanf(choice, "s[3]ddd",choice ,giveplayerid, amount, price)) return SendClientMessageEx(playerid, 0x008FECFF, "Modo de uso: {FFFFFF}/vender rz [ID] [cantidad] [precio]");
if(amount < 0 || amount > 9999999)
{
SendClientMessageEx(playerid, COLOR_DIALOGO1, "ERROR: {FFFFFF}Los valores no pueden ser mayores a 9999999 monedas ni menores a 1.");
return 1;
}
if(IsPlayerConnected(playerid))
{
if(IsPlayerConnected(giveplayerid))
{
if(ProxDetectorS(8.0, playerid, giveplayerid))
{
if(giveplayerid == playerid) return SendClientMessageEx(playerid, 0x008FECFF, "Informaciуn: {FFFFFF}No puedes venderte a ti mismo.");
format(string, sizeof(string), "[Ventas] {FFFFFF}Le ofreciste {F5FF00}%s {FFFFFF}Monedas Rz a {F5FF00}%s {FFFFFF}por {00CC00}$%d", amount, GetPlayerNameEx(giveplayerid), price);
SendClientMessageEx(playerid, 0x00CC00FF, string);
format(string, sizeof(string), "%s {FFFFFF}te ofrece {F5FF00}%s {FFFFFF}Monedas Rz por {00CC00}$%d, {FFFFFF}para aceptarla usa {F5FF00}/aceptar rz", GetPlayerNameEx(playerid), amount, price);
SendClientMessageEx(giveplayerid, 0xF5FF00FF, string);
FOffer[giveplayerid] = playerid;
FPrice[giveplayerid] = price;
return FAmount[giveplayerid] = amount;
}
else return SendClientMessageEx(playerid, COLOR_DIALOGO1, "ERROR: {FFFFFF}Ese jugador estб lejos de ti.");
}
}
else SendClientMessageEx(playerid, COLOR_DIALOGO1, "ERROR: {FFFFFF}ID Invбlida.");
return 1;
}
else SendClientMessageEx(playerid, COLOR_DIALOGO1, "ERROR: {FFFFFF}Has ingresado un comando incorrecto, usa /vender [Item]");
return 1;
}
Try this
pawn Код:
|