28.11.2011, 22:27
simples, mude o comando /comprarmala por:
e o comando /darmala por:
pawn Код:
if(strcmp(cmdtext, "/comprarmala", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(GetPlayerMoney(playerid)<2000)return SendClientMessage(playerid, 0xFFFFFFFF,"Vocк nгo tem R$1000!");
SetPlayerAttachedObject( playerid, 0, 1212, 6, 0.118311, 0.029233, 0.029525, 0.000000, 260.214324, 0.000000, 1.000000, 1.000000, 1.000000 );
GivePlayerMoney(playerid, -2000);
}
return 1;
}
pawn Код:
if(strcmp(cmd, "/darmala", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "USO: /darmala [playerid/Parte-do-Nick] [quantia]");
return 1;
}
//giveplayerid = strval(tmp);
giveplayerid = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "USO: /darmala [playerid/Parte-do-Nick] [quantia]");
return 1;
}
moneys = strval(tmp);
if(moneys < 1 || moneys > 99999)
{
SendClientMessage(playerid, COLOR_GRAD1, "Escolha entre 1 e R$: 50000");
return 1;
}
if (IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
if(PlayerInfo[giveplayerid][pLocal] == 106)
{
SendClientMessage(playerid, COLOR_GRAD1, "Este comando nгo й habilitado para se usar nesse lugar.");
return 1;
}
if (ProxDetectorS(5.0, playerid, giveplayerid))
{
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
playermoney = GetPlayerMoneyEx(playerid);
if (moneys > 0 && playermoney >= moneys)
{
ConsumingMoney[giveplayerid] = 1;
GivePlayerMoneyEx(playerid, (0 - moneys));
GivePlayerMoneyEx(giveplayerid, moneys);
format(string, sizeof(string), " Vocк enviou R$: %d para %s(Jogador: %d)", moneys, giveplayer,giveplayerid);
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
SendClientMessage(playerid, COLOR_GRAD1, string);
format(string, sizeof(string), " Vocк recebeu R$: %d de %s(Jogador: %d).", moneys, sendername, playerid);
SendClientMessage(giveplayerid, COLOR_GRAD1, string);
format(string, sizeof(string), "%s pagou R$: %d para %s", sendername, moneys, giveplayer);
PayLog(string);
PlayerPlaySound(giveplayerid, 1052, 0.0, 0.0, 0.0);
format(string, sizeof(string), "%s deu algum dinheiro para %s.", sendername ,giveplayer);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " Quantia invбlida");
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " Vocк estб longe do persongem");
}
}//invalid id
}
else
{
format(string, sizeof(string), " %d nгo й um jogador Ativo.", giveplayerid);
SendClientMessage(playerid, COLOR_GRAD1, string);
}
}
return 1;
}