Hola amigos miren tengo un proble con el comando pagar funciona pero das dinero o recibis y te banea porqe dice cheat de dinero porqe es
Aca el comando
Aca el comando
- Spoiler:
- if(strcmp(cmd, "/pagar", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "[INFO]: /pagar [JugadorId/ParteDelNombre] [amount]");
return 1;
}
//giveplayerid = strval(tmp);
giveplayerid = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "[INFO]: /pagar [JugadorId/ParteDelNombre] [amount]");
return 1;
}
moneys = strval(tmp);
if(moneys > 1000 && PlayerInfo[playerid][pLevel] < 3)
{
SendClientMessage(playerid, COLOR_GRAD1, "Necesitas ser mayor de lvl 3 para pasar mas de 1000");
return 1;
}
if(moneys < 1 || moneys > 99999)
{
SendClientMessage(playerid, COLOR_GRAD1, "Dont go below 1, or above 99999 at once.");
return 1;
}
if (IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
if(PlayerInfo[giveplayerid][pLocal] == 106)
{
SendClientMessage(playerid, COLOR_GRAD1, "Command not allowed in this location");
return 1;
}
if (ProxDetectorS(5.0, playerid, giveplayerid))
{
if(giveplayerid == playerid)
{
SendClientMessage(playerid, COLOR_GREY, " You can not pay for yourself !");
return 1;
}
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
playermoney = GetPlayerMoney(playerid);
if (moneys > 0 && playermoney >= moneys)
{
//ConsumingMoney[giveplayerid] = 1;
GivePlayerMoneyGR(playerid, (0 - moneys));
GivePlayerMoneyGR(giveplayerid, moneys);
format(string, sizeof(string), " Enviastet %s(player: %d), $%d.", giveplayer,giveplayerid, moneys);
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
SendClientMessage(playerid, COLOR_GRAD1, string);
format(string, sizeof(string), " You have recieved $%d from %s(player: %d).", moneys, sendername, playerid);
SendClientMessage(giveplayerid, COLOR_GRAD1, string);
format(string, sizeof(string), "%s saca un poco de su dinero y se lo entrega a $%d to %s", sendername, moneys, giveplayer);
PayLog(string);
if(moneys >= 1000000)
{
ABroadCast(COLOR_YELLOW,string,1);
}
PlayerPlaySound(giveplayerid, 1052, 0.0, 0.0, 0.0);
/*format(string, sizeof(string), "* %s takes out some cash, and hands it to %s.", sendername ,giveplayer);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);*/
ApplyAnimation(playerid,"DEALER","shop_pay",4.1,0,0,0,0,0);
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " Invalid transaction amount.");
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " Your too far away.");
}
}//invalid id
}
else
{
format(string, sizeof(string), " %d is not an active player.", giveplayerid);
SendClientMessage(playerid, COLOR_GRAD1, string);
}
}
return 1;
}
if(strcmp(cmd, "/tirar", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "[INFO]: /tirar [amount]");
return 1;
}
if(PlayerInfo[playerid][pLocal] == 106)
{
SendClientMessage(playerid, COLOR_GRAD1, "Command not allowed in this location");
return 1;
}
moneys = strval(tmp);
if(moneys < 0)
{
SendClientMessage(playerid, COLOR_GRAD1, "That is not enough.");
return 1;
}
if(GetPlayerMoney(playerid) < moneys)
{
SendClientMessage(playerid, COLOR_GRAD1, "You don't have that much money.");
return 1;
}
GivePlayerMoneyGR(playerid, -moneys);
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "%s, gracias por NO donar ese dinero...",sendername);
printf("%s", string);
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
SendClientMessage(playerid, COLOR_GRAD1, string);
PayLog(string);
}
return 1;
}