21.12.2014, 19:43
Pessoal estou com uma dъvida. Estou querendo fazer um CMD para os policiais do meu servidor. Para eles poder retirar algo do jogador, Exemplo. Armas,Drogas,Materiais. Mais eu quero fazer diferente um exemplo!
Ai tipo o policial irб tem que retirar algo que o bandido tem no caso se for , drogas, dinamite etc...
Ai ele digita o comando
/Retirar [DROGAS] AI AS DROGAS SГO RETIRADAS
OU EM OUTRO CASO /RETIRAR [DINAMITES] AS DINAMITE SГO RETIRAR
COMO NESSE EXEMPLO DO GF.
MAIS EU NГO SEI FAZER ISSO EM ZCMD ESSE Й O PROBLEMA
pawn Код:
CMD:retirar(playerid)
{
if(sscanf(params,"s",Variavel)) return SendClientMessage(playerid,VERDE_BEM_CLARO,"USE: /retirar [ARMAS, MATERIAIS, DROGAS, DINAMITE]");
// O SISTEMA
return true;
}
Ai ele digita o comando
/Retirar [DROGAS] AI AS DROGAS SГO RETIRADAS
OU EM OUTRO CASO /RETIRAR [DINAMITES] AS DINAMITE SГO RETIRAR
COMO NESSE EXEMPLO DO GF.
pawn Код:
if(strcmp(cmd, "/retirar", 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;
}
if(gTeam[playerid] == 2 || IsACop(playerid) || IsAGOV(playerid))
{
if(PlayerInfo[playerid][pCargo] < 2)
{
SendClientMessage(playerid, COLOR_GREY, " Vocк precisa de cargo 2 para usar este comando !");
return 1;
}
new x_nr[32];
x_nr = strtok(cmdtext, idx);
if(!strlen(x_nr)) {
SendClientMessage(playerid, COLOR_WHITE, "{9AC0CD} • • • • • • • • • • • • • • • • • • ( {BFEFFF}Retirar Algo do jogador{9AC0CD} ) • • • • • • • • • • • • • • • • • • ");
SendClientMessage(playerid, COLOR_WHITE, "USE: /retirar [nome] [id]");
SendClientMessage(playerid, COLOR_GREY, "Nomes Disponнveis: Armas, Drogas, Materiais");
return 1;
}
else if(strcmp(x_nr,"Armas",true) == 0)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid, COLOR_WHITE, "USE: /retirar Armas [id]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
GetPlayerName(giveplayerid, sendername, sizeof(sendername));
if (ProxDetectorS(8.0, playerid, giveplayerid))
{
new cop[MAX_PLAYER_NAME];
GetPlayerName(playerid, cop, sizeof(cop));
new fudido[MAX_PLAYER_NAME];
GetPlayerName(giveplayerid, fudido, sizeof(fudido));
format(string, sizeof(string), "* Vocк retirou as Armas de %s.", fudido);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* Oficial %s retirou suas Armas.", cop);
SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
ResetPlayerWeaponsEx(giveplayerid);
OnMafiaEquipado[playerid] = 0;
}
else
{
SendClientMessage(playerid, COLOR_GREY, " O Jogador estб longe de Vocк !");
return 1;
}
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " O Jogador Estб Offline !");
return 1;
}
}
else if(strcmp(x_nr,"Drogas",true) == 0)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid, COLOR_WHITE, "USE: /retirar Drogas [id]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
GetPlayerName(giveplayerid, sendername, sizeof(sendername));
if (ProxDetectorS(8.0, playerid, giveplayerid))
{
new cop[MAX_PLAYER_NAME];
GetPlayerName(playerid, cop, sizeof(cop));
new fudido[MAX_PLAYER_NAME];
GetPlayerName(giveplayerid, fudido, sizeof(fudido));
format(string, sizeof(string), "* Vocк retirou as Drogas de %s.", fudido);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* Oficial %s retirou suas Drogas.", cop);
SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
PlayerInfo[giveplayerid][pDrogas] = 0;
PlayerInfo[giveplayerid][pDrogas2] = 0;
PlayerInfo[giveplayerid][pDrogas3] = 0;
}
else
{
SendClientMessage(playerid, COLOR_GREY, " O Jogador estб longe de Vocк !");
return 1;
}
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " O Jogador Estб Offline !");
return 1;
}
}
else if(strcmp(x_nr,"Materiais",true) == 0)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid, COLOR_WHITE, "USE: /retirar Materiais [id]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
GetPlayerName(giveplayerid, sendername, sizeof(sendername));
if (ProxDetectorS(8.0, playerid, giveplayerid))
{
new cop[MAX_PLAYER_NAME];
GetPlayerName(playerid, cop, sizeof(cop));
new fudido[MAX_PLAYER_NAME];
GetPlayerName(giveplayerid, fudido, sizeof(fudido));
format(string, sizeof(string), "* Vocк retirou os Materiais de %s.", fudido);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* Oficial %s Retirou seus Materiais.", cop);
SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
PlayerInfo[giveplayerid][pMats] = 0;
}
else
{
SendClientMessage(playerid, COLOR_GREY, " O Jogador estб longe de Vocк !");
return 1;
}
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " O Jogador Estб Offline !");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Nome invбlido !");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Vocк nгo e COP !");
return 1;
}
}
return 1;
}