CMD:retirar(playerid)
{
if(sscanf(params,"s",Variavel)) return SendClientMessage(playerid,VERDE_BEM_CLARO,"USE: /retirar [ARMAS, MATERIAIS, DROGAS, DINAMITE]");
// O SISTEMA
return true;
}
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;
}
if(strcmp(params[0], "Drogas", true, 10) == 0){
// Cуdigo
return 1;
}
if(strcmp(params[0], "Armas", true, 10) == 0){
// Cуdigo
return 1;
}
Da pra fazer com strcmp tente:
pawn Код:
|
CMD:filho(playerid, params[]){
if(strcmp(params[0], "Filho", true, 10) == 0){
// Sou seu filho
return 1;
}
if(strcmp(params[0], "NaoFilho", true, 10) == 0){
// Nгo sou seu filho
return 1;
}
}
- Nгo sou seu filho
pawn Код:
|
CMD:retirar(playerid, params[])
{
new idplayer, text[15], aname[2][MAX_PLAYER_NAME], string[120];
if(sscanf(params, "is", idplayer, text)) return SendClientMessage(playerid,-1,"[ ERRO ] {FF0000}USE: /retirar [playerid] [ARMAS, MATERIAIS, DROGAS, DINAMITE]");
if(!IsPlayerConnected(idplayer)) return SendClientMessage(playerid, -1, "[ ERRO ] {FF0000}Este player nгo estб conectado!");
GetPlayerName(playerid, aname[0], MAX_PLAYER_NAME);
GetPlayerName(idplayer, aname[1], MAX_PLAYER_NAME);
if(strcmp(text, "armas", true) == 0)
{
format(string, 120,"| INFO | O(A) policial %s retirou as armas do(a) bandido(a) %s!", aname[0] ,aname[1]);
SendClientMessageToAll(0x00FF80AA, string);
return 1;
}
else if(strcmp(text, "materiais", true) == 0)
{
format(string, 120,"| INFO | O(A) policial %s retirou os materiais do(a) bandido(a) %s!", aname[0] ,aname[1]);
SendClientMessageToAll(0x00FF80AA, string);
return 1;
}
else if(strcmp(text, "drogas", true) == 0)
{
format(string, 120,"| INFO | O(A) policial %s retirou as drogas do(a) bandido(a) %s!", aname[0] ,aname[1]);
SendClientMessageToAll(0x00FF80AA, string);
return 1;
}
else if(strcmp(text, "dinamite", true) == 0)
{
format(string, 120,"| INFO | O(A) policial %s retirou as dinamites do(a) bandido(a) %s!", aname[0] ,aname[1]);
SendClientMessageToAll(0x00FF80AA, string);
return 1;
}
return 1;
}
Espero ter ajudado!
PHP код:
|
CMD:retirar(playerid,params[])
{
new var[10],ID;
if(sscanf(params,"us"ID,var) return SendClientMessage(playerid,-1,"/retirar [id] [itens]");
if(strcmp(var,"armas",true) == 0)
{
ResetPlayerWeapons(ID);
SendClientMessage(ID,-1,"Retiraram tuas armas!");
}
else if(strcmp(var,"drogas",true) == 0)
{
//etc...
}
else SendClientMessage(playerid,-1,"itens:drogas,armas");
return 1;
}