30.01.2015, 14:37
Pessoal o que estб errado neste comando ? , estou tentando fazer um comando /MA ( Megafone Admin ) , em base do /M ( Megafone Policial ) , mais quando tou compilando estб aparecendo que o pawn libray(algo assim) parou de funcionar , o que estб errado ?
Estou tentando usar /M do mefafone , base :
O Que estб errado ?
Estou tentando usar /M do mefafone , base :
pawn Код:
if(strcmp(cmd, "/megafone", true) == 0 || strcmp(cmd, "/m", true) == 0)
{
if(PlayerInfo[playerid][pMuted] == 1)
{
SendClientMessage(playerid, TEAM_CYAN_COLOR, "Vocк nгo pode falar, pois foi calado");
return true;
}
if(IsPlayerConnected(playerid))
{
if(!IsACop(playerid))
{
SendClientMessage(playerid, COLOR_GREY, " Vocк nгo й um policial!");
return true;
}
if(OnDuty[playerid] != 1)
{
SendClientMessage(playerid, COLOR_GREY, " Vocк nгo Bateu o cartгo!");
return true;
}
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: (/m)egafone [texto]");
return true;
}
if(gTeam[playerid] == 2 || IsACop(playerid))
{
if(PlayerInfo[playerid][pMembro] == 1||PlayerInfo[playerid][pLider] == 1)
{
format(string, sizeof(string), "[Policial Militar %s:o< %s]", sendername, result);
ProxDetector(60.0, playerid, string,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
}
else if(PlayerInfo[playerid][pMembro] == 2||PlayerInfo[playerid][pLider] == 2)
{
format(string, sizeof(string), "[Rotam %s:o< %s]", sendername, result);
ProxDetector(60.0, playerid, string,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
}
else if(PlayerInfo[playerid][pMembro] == 27||PlayerInfo[playerid][pLider] == 27)
{
format(string, sizeof(string), "[Policial Militar %s:o< %s]", sendername, result);
ProxDetector(60.0, playerid, string,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
}
else if(PlayerInfo[playerid][pMembro] == 3||PlayerInfo[playerid][pLider] == 3)
{
format(string, sizeof(string), "[Exйrcito %s:o< %s]", sendername, result);
ProxDetector(60.0, playerid, string,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
}
else if(IsAGOV(playerid))
{
format(string, sizeof(string), "[Governo %s:o< %s]", sendername, result);
ProxDetector(60.0, playerid, string,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
}
else if(PlayerInfo[playerid][pMembro] == 16||PlayerInfo[playerid][pLider] == 16)
{
format(string, sizeof(string), "[Rotam-SF %s:o< %s]", sendername, result);
ProxDetector(60.0, playerid, string,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
}
else if(PlayerInfo[playerid][pMembro] == 11||PlayerInfo[playerid][pLider] == 11)
{
format(string, sizeof(string), "[Policia Federal %s:o< %s]", sendername, result);
ProxDetector(60.0, playerid, string,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
}
else if(PlayerInfo[playerid][pMembro] == 33||PlayerInfo[playerid][pLider] == 33)
{
format(string, sizeof(string), "[Policial Rodoviбrio %s:o< %s]", sendername, result);
ProxDetector(60.0, playerid, string,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
}
printf("%s", string);
}
else
{
SendClientMessage(playerid, COLOR_GRAD2, " Vocк nгo faz parte de nenhuma equipe !");
return true;
}
}
return true;
}
pawn Код:
if(strcmp(cmd, "/megafoneadmin", true) == 0 || strcmp(cmd, "/ma", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if (PlayerInfo[playerid][pAdmin] >= 1)
{
SendClientMessage(playerid, COLOR_GREY, " Vocк nгo й um admin!");
return true;
}
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: (/ma)egafoneAdmin [Texto]");
return true;
}
if(PlayerInfo[playerid][pSex] == 1) // Aqui verefica o sexo para ver "Administrador(A)" 1 = Masculino | 2 = Feminino!
}
if(PlayerInfo[playerid][pAdmin] == 1) // Aqui verefica se ele й admin .
{
format(string, sizeof(string), "[Administrador %s:o< %s]", sendername, result); // Administrador Masculino!
ProxDetector(60.0, playerid, string,COR_Medicos);
}
if(PlayerInfo[playerid][pSex] == 2)
}
format(string, sizeof(string), "[Administradora %s:o< %s]", sendername, result); // Administrador Feminino
ProxDetector(60.0, playerid, string,COR_Medicos);
}
printf("%s", string);
}
else
{
SendClientMessage(playerid, COLOR_GRAD2, " Vocк nгo й um administrador (A)!");
return true;
}
}
return true;
}