18.07.2012, 14:02
eu queria criar um comando igual dos cops, de /megafone que nos usamos como /m. numero da org do detran e 26. ajdua ae...
if (strcmp(cmd, "/megafone", true) == 0 || strcmp(cmd, "/m", true) == 0) {
if (PlayerInfo[playerid][pMuted] == 1) {
MSGPLAYER(playerid, TEAM_CYAN_COLOR, "Vocк nгo pode falar, pois foi calado");
return 1;
}
if (IsPlayerConnected(playerid)) {
if (!IsACop(playerid)) {
MSGPLAYER(playerid, COLOR_GREY, " Vocк nгo й um policial!");
return 1;
}
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)) {
MSGPLAYER(playerid, COLOR_GRAD2, "USE: (/m)egafone [megaphone chat]");
return 1;
}
if (gTeam[playerid] == 2 || IsACop(playerid)) {
if (PlayerInfo[playerid][pMembro] == 1 || PlayerInfo[playerid][pLider] == 1) {
format(string, sizeof(string), "Policial Militar %s< %s", sendername, result);
ProxDetector(60.0, playerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLO R_YELLOW, COLOR_YELLOW);
}
else if (PlayerInfo[playerid][pMembro] == 2 || PlayerInfo[playerid][pLider] == 2) {
format(string, sizeof(string), "B.O.P.E %s< %s", sendername, result);
ProxDetector(60.0, playerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLO R_YELLOW, COLOR_YELLOW);
}
else if (PlayerInfo[playerid][pMembro] == 3 || PlayerInfo[playerid][pLider] == 3) {
format(string, sizeof(string), "Exйrcito %s< %s", sendername, result);
ProxDetector(60.0, playerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLO R_YELLOW, COLOR_YELLOW);
}
else if (IsAGOV(playerid)) {
format(string, sizeof(string), "Governo %s< %s", sendername, result);
ProxDetector(60.0, playerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLO R_YELLOW, COLOR_YELLOW);
}
else if (PlayerInfo[playerid][pMembro] == 16 || PlayerInfo[playerid][pLider] == 16) {
format(string, sizeof(string), "Policia Civil %s< %s", sendername, result);
ProxDetector(60.0, playerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLO R_YELLOW, COLOR_YELLOW);
}
else if (PlayerInfo[playerid][pMembro] == 11 || PlayerInfo[playerid][pLider] == 11) {
format(string, sizeof(string), "Policia Federal %s< %s", sendername, result);
ProxDetector(60.0, playerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLO R_YELLOW, COLOR_YELLOW);
}
else if (PlayerInfo[playerid][pMembro] == 26 || PlayerInfo[playerid][pLider] == 26) {
format(string, sizeof(string), "D.E.T.R.A.N %s< %s", sendername, result);
ProxDetector(60.0, playerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLO R_YELLOW, COLOR_YELLOW);
}
printf("%s", string);
}
else {
MSGPLAYER(playerid, COLOR_GRAD2, " Vocк nгo faz parte de nenhuma equipe !");
return 1;
}
}
return 1;
}
if (strcmp(cmd, "/megafone", true) == 0 || strcmp(cmd, "/m", true) == 0) {
if (PlayerInfo[playerid][pMuted] == 1) {
MSGPLAYER(playerid, TEAM_CYAN_COLOR, "Vocк nгo pode falar, pois foi calado");
return 1;
}
if (IsPlayerConnected(playerid)) {
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)) {
MSGPLAYER(playerid, COLOR_GRAD2, "USE: (/m)egafone [megaphone chat]");
return 1;
}
if (PlayerInfo[playerid][pMembro] == 26 || PlayerInfo[playerid][pLider] == 26){
format(string, sizeof(string), "D.E.T.R.A.N %s< %s", sendername, result);
ProxDetector(60.0, playerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLO R_YELLOW, COLOR_YELLOW);
}
if (!IsACop(playerid)) {
MSGPLAYER(playerid, COLOR_GREY, " Vocк nгo й um policial!");
return 1;
}
if (gTeam[playerid] == 2 || IsACop(playerid)) {
if (PlayerInfo[playerid][pMembro] == 1 || PlayerInfo[playerid][pLider] == 1) {
format(string, sizeof(string), "Policial Militar %s< %s", sendername, result);
ProxDetector(60.0, playerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLO R_YELLOW, COLOR_YELLOW);
}
else if (PlayerInfo[playerid][pMembro] == 2 || PlayerInfo[playerid][pLider] == 2) {
format(string, sizeof(string), "B.O.P.E %s< %s", sendername, result);
ProxDetector(60.0, playerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLO R_YELLOW, COLOR_YELLOW);
}
else if (PlayerInfo[playerid][pMembro] == 3 || PlayerInfo[playerid][pLider] == 3) {
format(string, sizeof(string), "Exйrcito %s< %s", sendername, result);
ProxDetector(60.0, playerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLO R_YELLOW, COLOR_YELLOW);
}
else if (IsAGOV(playerid)) {
format(string, sizeof(string), "Governo %s< %s", sendername, result);
ProxDetector(60.0, playerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLO R_YELLOW, COLOR_YELLOW);
}
else if (PlayerInfo[playerid][pMembro] == 16 || PlayerInfo[playerid][pLider] == 16) {
format(string, sizeof(string), "Policia Civil %s< %s", sendername, result);
ProxDetector(60.0, playerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLO R_YELLOW, COLOR_YELLOW);
}
else if (PlayerInfo[playerid][pMembro] == 11 || PlayerInfo[playerid][pLider] == 11) {
format(string, sizeof(string), "Policia Federal %s< %s", sendername, result);
ProxDetector(60.0, playerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLO R_YELLOW, COLOR_YELLOW);
}
printf("%s", string);
}
else {
MSGPLAYER(playerid, COLOR_GRAD2, " Vocк nгo faz parte de nenhuma equipe !");
return 1;
}
}
return 1;
}
mais e um so pra detran, n pra policia civil pm n e pra esse so pra detran, tem como, igual esse, mais so pra detran
|
if (strcmp(cmd, "/dmegafone", true) == 0 || strcmp(cmd, "/d", true) == 0) {
if (PlayerInfo[playerid][pMuted] == 1)return MSGPLAYER(playerid, TEAM_CYAN_COLOR, "Vocк nгo pode falar, pois foi calado");
if (IsPlayerConnected(playerid))
{
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)) { MSGPLAYER(playerid, COLOR_GRAD2, "USE: (/m)egafone [megaphone chat]"); return 1; }
if (PlayerInfo[playerid][pMembro] == 26 || PlayerInfo[playerid][pLider] == 26){
format(string, sizeof(string), "D.E.T.R.A.N %s< %s", sendername, result);
ProxDetector(60.0, playerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLO R_YELLOW, COLOR_YELLOW);
}
else { MSGPLAYER(playerid, COLOR_GRAD2, " Vocк nгo faz parte de nenhuma equipe !"); return 1;}
}
return 1;
}