if(strcmp(cmd, "/vozdeprisao", true) == 0) { new aname[MAX_PLAYER_NAME]; GetPlayerName(playerid, aname, MAX_PLAYER_NAME); format(file, sizeof(file), PASTA_CONTAS, aname); if(dini_Int(file, "Profissao") == Policia_Militar || dini_Int(file, "Profissao") == Policia_Civil || dini_Int(file, "Profissao") == Policia_Federal || dini_Int(file, "Profissao") == Delegado || dini_Int(file, "Profissao") == Bope || dini_Int(file, "Profissao") == Swat || dini_Int(file, "Profissao") == Narcoticos || dini_Int(file, "Profissao") == FBI || dini_Int(file, "Profissao") == Interpol || dini_Int(file, "aAdmin") == 1){ new modelo; new id = strval(tmp); modelo = GetVehicleModel(GetPlayerVehicleID(playerid)); if(modelo == 427 || modelo == 597 || modelo == 490 || modelo == 497 || modelo == 596 || modelo == 598) { new plid; new msg[256]; tmp = strtok(cmdtext, idx); if(!strlen(tmp)){ SendClientMessage(playerid, Vermelho, " /vozdeprisao [id] [motivo]"); return 1; } plid = strval(tmp); msg = strtok(cmdtext, idx); if(!strlen(msg)){ SendClientMessage(playerid, Verde,"| ERRO | Use /vozdeprisao [id] [motivo]"); return 1; } if(Algemado[id] == false) { SendClientMessage(playerid, Vermelho, " | ERRO | O jogador precisa estar algemado para dar Voz De Prisão!"); return 1; } if(GetPlayerWantedLevel(id) <= 4) { SendClientMessage(playerid, Vermelho, " | ERRO | Esse jogador não está sendo procurado level + que 5 pela policia."); return 1; } plid = strval(tmp); if(plid == playerid){ SendClientMessage(playerid, Vermelho, "| ERRO | Você não pode usar este comando em você mesmo."); return 1 ; } if(!IsPlayerConnected(plid)){ SendClientMessage(playerid, Vermelho, "| ERRO | Jogador não conectado."); return 1; } else { if(GetDistanceBetweenPlayers(plid,playerid) < 15){ new result[100]; format(string, sizeof(string), "| INFO | Você foi colocado na viatura por %s Motivo: %s !",aname, result);//ai essa pohan ta certa SendClientMessage(plid, Branco, string); dini_IntSet(file2, "Procurados", 0); TogglePlayerControllable(plid, 0); RemovePlayerAttachedObject(plid, 4); SendClientMessage(playerid, Amarelo, "| INFO | Colocado na viatura, va ate a garagem da DP e prenda!");//perae vamo pesquisar new pname[MAX_PLAYER_NAME]; GetPlayerName(plid,pname,MAX_PLAYER_NAME); format(string, sizeof(string),"[Corregedoria]O Policial %s(ID: %d) Deu voz de Prisão no %s(ID: %d)", aname,playerid,pname,plid,tmp); Comandosp(Roxo,string,1);//go la ver agora new VehicleID; VehicleID = GetPlayerVehicleID(playerid); PutPlayerInVehicle(plid,VehicleID,2); return 1; } else { SendClientMessage(playerid,Vermelho," Chegue mais perto !"); return 1; } } } else { SendClientMessage(playerid,Vermelho,"| ERRO | Você não está em uma Viatura da Policia!"); return 1; } } else { SendClientMessage(playerid,Vermelho,"(ERRO) Você não é um policial!"); return 1; } }
if(strcmp(cmd, "/vozdeprisao", true) == 0)
{
new aname[MAX_PLAYER_NAME];
GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
format(file, sizeof(file), PASTA_CONTAS, aname);
if(dini_Int(file, "Profissao") == Policia_Militar || dini_Int(file, "Profissao") == Policia_Civil || dini_Int(file, "Profissao") == Policia_Federal || dini_Int(file, "Profissao") == Delegado || dini_Int(file, "Profissao") == Bope || dini_Int(file, "Profissao") == Swat || dini_Int(file, "Profissao") == Narcoticos || dini_Int(file, "Profissao") == FBI || dini_Int(file, "Profissao") == Interpol || dini_Int(file, "aAdmin") == 1)
{
new msg[256];
new plid = strval(tmp);
new modelo = GetVehicleModel(GetPlayerVehicleID(playerid));
if(modelo == 427 || modelo == 597 || modelo == 490 || modelo == 497 || modelo == 596 || modelo == 598)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) return SendClientMessage(playerid, Vermelho, " /vozdeprisao [id] [motivo]");
plid = strval(tmp);
msg = strtok(cmdtext, idx);
if(!strlen(msg)) return SendClientMessage(playerid, Verde,"| ERRO | Use /vozdeprisao [id] [motivo]");
if(Algemado[plid] == false) return SendClientMessage(playerid, Vermelho, " | ERRO | O jogador precisa estar algemado para dar Voz De Prisгo!");
if(GetPlayerWantedLevel(plid) <= 4) return SendClientMessage(playerid, Vermelho, " | ERRO | Esse jogador nгo estб sendo procurado level + que 5 pela policia.");
plid = strval(tmp);
if(plid == playerid) return SendClientMessage(playerid, Vermelho, "| ERRO | Vocк nгo pode usar este comando em vocк mesmo.");
if(!IsPlayerConnected(plid)) return SendClientMessage(playerid, Vermelho, "| ERRO | Jogador nгo conectado.");
if(GetDistanceBetweenPlayers(plid, playerid) < 15)
{
new ptname[MAX_PLAYER_NAME];
GetPlayerName(plid, ptname, MAX_PLAYER_NAME);
format(file2, sizeof(file2), PASTA_CONTAS, ptname);
new result[100];
format(string, sizeof(string), "| INFO | Vocк foi colocado na viatura por %s Motivo: %s !",aname, result);
SendClientMessage(plid, Branco, string);
dini_IntSet(file2, "Procurados", 0);
TogglePlayerControllable(plid, 0);
RemovePlayerAttachedObject(plid, 4);
SendClientMessage(playerid, Amarelo, "| INFO | Colocado na viatura, va ate a garagem da DP e prenda!");//perae vamo pesquisar
format(string, sizeof(string),"[Corregedoria]O Policial %s(ID: %d) Deu voz de Prisгo no %s(ID: %d)", aname, playerid, ptname,plid,tmp);
Comandosp(Roxo,string,1);//go la ver agora
new VehicleID;
VehicleID = GetPlayerVehicleID(playerid);
PutPlayerInVehicle(plid,VehicleID,2);
return 1;
}
else SendClientMessage(playerid,Vermelho," Chegue mais perto !");
}
else SendClientMessage(playerid,Vermelho,"| ERRO | Vocк nгo estб em uma Viatura da Policia!");
}
else SendClientMessage(playerid,Vermelho,"(ERRO) Vocк nгo й um policial!");
}
pawn Код:
tenta ae pra ver se da PS: tens de modernizar o teu code, comecar a usar a sscanf, deixar a dini e usar DOF2 ou outro sistema de salvamento, e para os comandos tens de usar um processador de comandos recomendo o ICMD da IPSI |
pq e mais rapido, melhor, vc ganha muito mais velocidade em salvamento de dados e leitura.
alem que dini ja e velha ela esta outdated. pode demorar e dar trabalho mas compensa acredite. |
if(strcmp(cmd, "/prender", true) == 0) { new aname[MAX_PLAYER_NAME]; GetPlayerName(playerid, aname, MAX_PLAYER_NAME); format(file, sizeof(file), PASTA_CONTAS, aname); if(dini_Int(file, "Profissao") == Policia_Militar || dini_Int(file, "Profissao") == Policia_Civil || dini_Int(file, "Profissao") == Policia_Federal || dini_Int(file, "Profissao") == Delegado || dini_Int(file, "Profissao") == Bope || dini_Int(file, "Profissao") == Swat || dini_Int(file, "Profissao") == Narcoticos || dini_Int(file, "Profissao") == FBI || dini_Int(file, "Profissao") == Interpol || dini_Int(file, "aAdmin") == 1){ new plid; new id = strval(tmp); tmp = strtok(cmdtext, idx); if(!strlen(tmp)){ SendClientMessage(playerid, Vermelho, "/prender [id]"); return 1; } if(!IsPlayerConnected(plid)){ plid = strval(tmp); if(plid == playerid){ SendClientMessage(playerid, Vermelho, "| ERRO | Você não pode usar este comando em você mesmo."); return 1 ; } SendClientMessage(playerid, Vermelho, "(ERRO) Jogador não conectado."); return 1; } else { if(PlayerToPoint(4.0, playerid,1560.0999755859,-1635.5,12.60000038147)){ plid = strval(tmp); if(GetPlayerVehicleID(playerid) == GetPlayerVehicleID(plid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER){ new pname[MAX_PLAYER_NAME]; GetPlayerName(plid, pname, MAX_PLAYER_NAME); format(file2, sizeof(file2), PASTA_CONTAS, pname); format(string, sizeof(string), "| INFO | O policial %s te prendeu.", aname); SendClientMessage(plid, Azul, string); SetPlayerPos(plid, 263.8820,77.4002,1001.0391); SetPlayerInterior(plid,6); SetPlayerHealth(plid, 99999); dini_IntSet(file2, "Preso", 1); dini_IntSet(file2, "Procurados", 0); ResetPlayerWeapons(plid); ClearAnimations(plid); TogglePlayerControllable(plid,1); SetPlayerSpecialAction(plid,0); SendClientMessage(playerid, VerdeClaro, "| INFO | Voce Prendeu o Procurado Pela Justiça e Ganhou 1300!"); Preso[playerid] = 1; preso[plid] = 1; Algemado[id] = false; Procurados[plid] = 0; SetPlayerWantedLevel(id, 0); TogglePlayerControllable(plid, 1); if(Procurados[plid] == 0){ dini_IntSet(file2, "Procurados", 0); GivePlayerGrana(playerid,1300); GetPlayerName(plid,pname,MAX_PLAYER_NAME); format(string, sizeof(string),"[Corregedoria]O Policial %s(ID: %d) Prendeu %s(ID: %d)", aname,playerid,pname,plid); Comandosp(Roxo,string,1); } return 1; } else { SendClientMessage(playerid,Vermelho," O jogador não esta no seu veiculo ou você não esta nele!"); return 1; } } else { SendClientMessage(playerid,Vermelho,"Coloque-o na viatura(/vozdeprisao) e va ate a Dp para prende-lo!"); return 1; } } } else { SendClientMessage(playerid,Vermelho," Apenas Policiais podem fazer isso!"); return 1; } }
if(id == playerid)
return algo...