Comando /multar -
GabrielFerreira - 17.03.2014
Preciso de ajuda, quando eu digito /multar [ID] [QUANTIDADE] [MOTIVO], eu nгo ganho o valor da multa, й cobrado do player, mas eu nгo ganho a grana.
PHP код:
if(strcmp(cmd, "/multar", true) == 0)
{
new aname[MAX_PLAYER_NAME];
GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
format(file, sizeof(file), P_CONTAS, aname);
if(dini_Int(file, "Profissao") == Policial_C || dini_Int(file, "Profissao") == Policial_F || dini_Int(file, "Profissao") == Marinha || dini_Int(file, "Profissao") == Terrestre || dini_Int(file, "Profissao") == Bope || dini_Int(file, "Profissao") == Swat || dini_Int(file, "Profissao") == Rotam || dini_Int(file, "Profissao") == Policial_M || dini_Int(file, "Profissao") == FBI || dini_Int(file, "Profissao") == Interpol || IsPlayerAdmin(playerid))
{
new plid;
new quant;
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid, Vermelho, "* /multar [id] [quantidade] [motivo]");
return 1;
}
plid = strval(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid, Vermelho, "/multar [id] [quantidade][motivo]");
return 1;
}
quant = strval(tmp);
if(quant > 1000 || quant <= 0) {
SendClientMessage(playerid, Vermelho, "| ERRO | Valor de 0 б 1000R$.");
return 1;
}
if(IsPlayerConnected(plid)) {
if( GetPVarInt( playerid, "TempoMultar" ) > GetTickCount() ) return SendClientMessage( playerid, 0xFF0000AA, "| ERRO | Vocк sу pode multar a cada 1 minuto." );
SetPVarInt( playerid, "TempoMultar", GetTickCount() + 60000 );
new pname[MAX_PLAYER_NAME];
GetPlayerName(plid, pname, MAX_PLAYER_NAME);
format(file, sizeof(file), P_CONTAS, pname);
format(string, sizeof(string), "| INFO | Vocк recebeu uma multa de '%dR$'. Por '%s'.", quant, aname);
SendClientMessage(plid, COLOR_GREEN, string);
SendClientMessage(playerid, COLOR_GREEN, "| INFO | Multa aplicada com sucesso.");
new crg[256];
format(crg, sizeof(crg), "| Policial | O(a) policial '%s' multou o jogador '%s'. Quantia: %dR$. Motivo: %s", aname, pname, quant);
Corregedor(0xC0C0C0AA,crg,1);
dini_IntSet(file, "SaldoBancario", dini_Int(file, "SaldoBancario")- quant);
return 1;
}
else {
SendClientMessage(playerid, Vermelho, "* O jogador nгo estб conectado!");
return 1;
}
}
}
Re: Comando /multar -
yNexus - 17.03.2014
PHP код:
if(strcmp(cmd, "/multar", true) == 0)
{
new aname[MAX_PLAYER_NAME];
GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
format(file, sizeof(file), P_CONTAS, aname);
if(dini_Int(file, "Profissao") == Policial_C || dini_Int(file, "Profissao") == Policial_F || dini_Int(file, "Profissao") == Marinha || dini_Int(file, "Profissao") == Terrestre || dini_Int(file, "Profissao") == Bope || dini_Int(file, "Profissao") == Swat || dini_Int(file, "Profissao") == Rotam || dini_Int(file, "Profissao") == Policial_M || dini_Int(file, "Profissao") == FBI || dini_Int(file, "Profissao") == Interpol || IsPlayerAdmin(playerid))
{
new plid;
new quant;
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid, Vermelho, "* /multar [id] [quantidade] [motivo]");
return 1;
}
plid = strval(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid, Vermelho, "/multar [id] [quantidade][motivo]");
return 1;
}
quant = strval(tmp);
if(quant > 1000 || quant <= 0) {
SendClientMessage(playerid, Vermelho, "| ERRO | Valor de 0 б 1000R$.");
return 1;
}
if(IsPlayerConnected(plid)) {
if( GetPVarInt( playerid, "TempoMultar" ) > GetTickCount() ) return SendClientMessage( playerid, 0xFF0000AA, "| ERRO | Vocк sу pode multar a cada 1 minuto." );
SetPVarInt( playerid, "TempoMultar", GetTickCount() + 60000 );
new pname[MAX_PLAYER_NAME];
GetPlayerName(plid, pname, MAX_PLAYER_NAME);
format(file, sizeof(file), P_CONTAS, pname);
format(string, sizeof(string), "| INFO | Vocк recebeu uma multa de '%dR$'. Por '%s'.", quant, aname);
SendClientMessage(plid, COLOR_GREEN, string);
SendClientMessage(playerid, COLOR_GREEN, "| INFO | Multa aplicada com sucesso.");
new crg[256];
format(crg, sizeof(crg), "| Policial | O(a) policial '%s' multou o jogador '%s'. Quantia: %dR$. Motivo: %s", aname, pname, quant);
Corregedor(0xC0C0C0AA,crg,1);
dini_IntSet(file, "SaldoBancario", dini_Int(file, "SaldoBancario")- quant);
GivePlayerMoney(playerid, quant);
return 1;
}
else {
SendClientMessage(playerid, Vermelho, "* O jogador nгo estб conectado!");
return 1;
}
}
}
Re: Comando /multar -
GabrielFerreira - 17.03.2014
O MOTIVO nгo estб aparecendo, e a grana conta , e some .
Re: Comando /multar -
yNexus - 17.03.2014
й por que vocк tem algum ant money, procura pela variaval do seu money e troca .
geralmente й
Re: Comando /multar -
GabrielFerreira - 17.03.2014
Eu troquei tudo por GivePlayerMoney , e deu vбrios erros.
Qual o lugar exato pra mim mudar ?
Re: Comando /multar -
GustavoG3D - 18.03.2014
Amigo se o SV for rpg de bater cartao aqui os codigos
MULTA
PHP код:
if(strcmp(cmd, "/multar", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(!IsACop(playerid))
{
SendClientMessage(playerid, COLOR_GREY, " Vocк nгo й um policial!");
return 1;
}
if(OnDuty[playerid] != 1)
{
SendClientMessage(playerid, COLOR_GREY, " Vocк nгo Bateu o cartгo!");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USE: /multar [ID] [Custo] [Razao]");
return 1;
}
giveplayerid = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USE: /multar [ID] [Custo] [Razao]");
return 1;
}
moneys = strval(tmp);
if(moneys < 1000 || moneys > 30000) { SendClientMessage(playerid, COLOR_GREY, "Custo entre 1000 e 30000 !"); return 1; }
if(IsPlayerConnected(giveplayerid))
{
if(IsACop(giveplayerid))
{
SendClientMessage(playerid, COLOR_GRAD1, "Vocк nгo pode multar Policiais!");
return 1;
}
if(PlayerInfo[giveplayerid][pJailed] > 0)
{
SendClientMessage(playerid, COLOR_GRAD1, "Vocк nгo pode multar jogadores que estejam presos!");
return 1;
}
if(giveplayerid != INVALID_PLAYER_ID)
{
if (ProxDetectorS(25.0, playerid, giveplayerid))
{
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "USE: /multar [ID] [Custo] [Razao]");
return 1;
}
format(string, sizeof(string), "* Vocк multou %s por $%d, Razao: %s", giveplayer, moneys, (result));
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* Oficial %s lhe deu uma multa no valor de $%d, Razao: %s", sendername, moneys, (result));
SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
SendClientMessage(giveplayerid, COLOR_LIGHTRED, "* Use /aceitar multa, para aceita-la.");
SendClientMessage(giveplayerid, COLOR_LIGHTRED, "* Se em 5 minutos vocк nгo pagar, irб preso!");
TicketOffer[giveplayerid] = playerid;
TicketMoney[giveplayerid] = moneys;
SetTimerEx("PresoMulta", 300000, false, "i", giveplayerid);
return 1;
}
else
{
SendClientMessage(playerid, COLOR_GREY, "O jogador estб longe !");
return 1;
}
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "O jogador estб Offline !");
return 1;
}
}
return 1;
}
Se nгo tiver bater cartao adicione
PHP код:
if(strcmp(cmd, "/batercartao", true) == 0)
{
if(PlayerInfo[playerid][pJailed] != 0)
{
SendClientMessage(playerid,COLOR_YELLOW," voce nao esta em local de bater cartao!");//
return true;
}
if(IsPlayerConnected(playerid))
{
GetPlayerName(playerid, sendername, sizeof(sendername));
if(IsACop(playerid))
{
//₢ORDENARDAS if (PlayerToPoint(2, playerid,255.2998,77.5604,1003.6406) || PlayerToPoint(2,playerid,-1616.1294,681.1594,7.1875) || PlayerToPoint(2,playerid,232.1218,162.1216,1003.0234) || PlayerToPoint(2, playerid,-2620.0579,-26.4158,4.1744) || PlayerToPoint(2, playerid,-1162.0723,-126.3712,14.2418)
|| PlayerToPoint(2, playerid,-2111.2493,-757.3846,32.2159) || PlayerToPoint(2,playerid,-2071.8071,-251.4861,35.3203) || PlayerToPoint(2,playerid,326.5193,307.0409,999.1484) || PlayerInfo[playerid][pLocal] != 255)
{
if(OnDuty[playerid]==0)
{
format(string, sizeof(string), "Oficial %s bateu o cartгo e estб em serviзo,digite /servico policia.", sendername);
OOCNews(COLOR_DBLUE,string);
//SetPlayerAttachedObject(playerid,3,18637,13,0.35,0.0,0.0,0.0,0.0,180.0);
SetPlayerArmour(playerid, 100);
SetPlayerHealth(playerid, 100);
ShowPlayerDialog(playerid,18021,DIALOG_STYLE_INPUT,"{FFFFFF}Troca De Skins" , "{FFFFFF}Digite O ID Da Sua\n{FFFFFF} Skin De Trabalho\n" , "Ok" , "Cancelar");
OnPlayerCommandText(playerid,"/equipar");
OnDuty[playerid] = 1;
EmpregoDuty[playerid] = 2;
Copsronda += 1;
}
else if(OnDuty[playerid]==1)
{
format(string, sizeof(string), "Oficial %s estб de folga e nгo vai mais receber seus chamados.", sendername);
OOCNews(COLOR_DBLUE,string);
//RemovePlayerAttachedObject(playerid,3);
OnDuty[playerid] = 0;
EmpregoDuty[playerid] = 0;
Copsronda -= 1;
}
}
// else
{
SendClientMessage(playerid, COLOR_GRAD2, "");
return true;
}
}
}
return true;
}
DEU ERROR ?ME CHAMA PRIVATO!
Sгo Paulo Style RPG : 74.63.198.171:6639 : San Fierro !
Re: Comando /multar -
GabrielFerreira - 18.03.2014
Olha, o meu nгo й de ORGS, й de profissхes .
Re: Comando /multar -
GabrielFerreira - 18.03.2014
Alguem ?