#push
sry falls es nicht erlaubt ist
#push
sry falls es nicht erlaubt ist
Alles anzeigenif(gTeam[playerid] == 2 || IsACop(playerid) || PlayerInfo[playerid][pMember] == 24||PlayerInfo[playerid][pLeader] == 24)
in
if(gTeam[playerid] == 2 || IsACop(playerid) || PlayerInfo[playerid][pMember] == 24||PlayerInfo[playerid][pLeader] == 24|| PayerInfo[playerid][pMember]==4|| PayerInfo[playerid][Leader]==4)
ersetzen und feddisch
guter Tipp schau immer ob irgendwo PlayerInfo Abfragen sind;)
/===============================MEGAPHONE=======================================
if(strcmp(cmd, "/megaphone", true) == 0 strcmp(cmd, "/m", true) == 0)
{
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(OnDuty[playerid]==0)
{
SendClientMessage(playerid, COLOR_GREY, "Du bist kein Beamter!");
return 1;
}
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "Benutze: (/m)egaphone [megaphone chat]");
return 1;
}
if(gTeam[playerid] == 2 IsACop(playerid) PlayerInfo[playerid][pMember] == 24||PlayerInfo[playerid][pLeader] == 24|| PayerInfo[playerid][pMember]==4|| PayerInfo[playerid][Leader]==4)
{
if(PlayerInfo[playerid][pMember] == 1||PlayerInfo[playerid][pLeader] == 1)
{
format(string, sizeof(string), "[Officer %s:o< %s]", sendername, result);
ProxDetector(60.0, playerid, string,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
}
else if(PlayerInfo[playerid][pMember] == 2||PlayerInfo[playerid][pLeader] == 2)
{
format(string, sizeof(string), "[Officer %s:o< %s]", sendername, result);
ProxDetector(60.0, playerid, string,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
}
else if(PlayerInfo[playerid][pMember] == 3||PlayerInfo[playerid][pLeader] == 3)
{
format(string, sizeof(string), "[Soldat %s:o< %s]", sendername, result);
ProxDetector(60.0, playerid, string,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
}
else if(PlayerInfo[playerid][pMember] ==Nr.4||PlayerInfo[playerid][pLeader] == Nr.4)
{
format(string, sizeof(string), "[Medic %s:o< %s]", sendername, result);
ProxDetector(60.0, playerid, string,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
}
else if(PlayerInfo[playerid][pMember] == 21||PlayerInfo[playerid][pLeader] == 21)
{
format(string, sizeof(string), "[FBI Agent %s:o< %s]", sendername, result);
ProxDetector(60.0, playerid, string,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
}
else if(PlayerInfo[playerid][pMember] == 23||PlayerInfo[playerid][pLeader] == 23)
{
format(string, sizeof(string), "[Soldat %s:o< %s]", sendername, result);
ProxDetector(60.0, playerid, string,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
}
else if(PlayerInfo[playerid][pMember] == 24||PlayerInfo[playerid][pLeader] == 24)
{
format(string, sizeof(string), "[O-Amt %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, " Du musst bei der Polizei/FBI/Bundeswehr sein, um diesen Befehl benutzen zu können !");
return 1;
}
}
return 1;
Also so funktioniert es nicht
Hallo
Ich weis nicht ob ich in diesem Sektor richtig bin. Aber ich stell die Frage einfach mal:
Und zwar habe ich auf meinem Server den Gamemode LosAngelesReallife. Ich habe mich ein wenig mit dem Script befasst und wollte nun einstellen, dass Medics auch das Megaphon nutzen können (also /m (text)). Ich hab mir also den Megaphone-Part des Scripts angeguckt, welcher so aussieht:
//===============================MEGAPHONE=======================================
if(strcmp(cmd, "/megaphone", true) == 0 || strcmp(cmd, "/m", true) == 0)
{
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(OnDuty[playerid]==0)
{
SendClientMessage(playerid, COLOR_GREY, "Du bist kein Beamter!");
return 1;
}
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "Benutze: (/m)egaphone [megaphone chat]");
return 1;
}
if(gTeam[playerid] == 2 || IsACop(playerid) || PlayerInfo[playerid][pMember] == 24||PlayerInfo[playerid][pLeader] == 24)
{
if(PlayerInfo[playerid][pMember] == 1||PlayerInfo[playerid][pLeader] == 1)
{
format(string, sizeof(string), "[Officer %s:o< %s]", sendername, result);
ProxDetector(60.0, playerid, string,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
}
else if(PlayerInfo[playerid][pMember] == 2||PlayerInfo[playerid][pLeader] == 2)
{
format(string, sizeof(string), "[Officer %s:o< %s]", sendername, result);
ProxDetector(60.0, playerid, string,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
}
else if(PlayerInfo[playerid][pMember] == 3||PlayerInfo[playerid][pLeader] == 3)
{
format(string, sizeof(string), "[Soldat %s:o< %s]", sendername, result);
ProxDetector(60.0, playerid, string,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
}
else if(PlayerInfo[playerid][pMember] == 4||PlayerInfo[playerid][pLeader] == 4)
{
format(string, sizeof(string), "[Medic %s:o< %s]", sendername, result);
ProxDetector(60.0, playerid, string,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
}
else if(PlayerInfo[playerid][pMember] == 21||PlayerInfo[playerid][pLeader] == 21)
{
format(string, sizeof(string), "[FBI Agent %s:o< %s]", sendername, result);
ProxDetector(60.0, playerid, string,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
}
else if(PlayerInfo[playerid][pMember] == 23||PlayerInfo[playerid][pLeader] == 23)
{
format(string, sizeof(string), "[Soldat %s:o< %s]", sendername, result);
ProxDetector(60.0, playerid, string,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
}
else if(PlayerInfo[playerid][pMember] == 24||PlayerInfo[playerid][pLeader] == 24)
{
format(string, sizeof(string), "[O-Amt %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, " Du musst bei der Polizei/FBI/Bundeswehr sein, um diesen Befehl benutzen zu können !");
return 1;
}
}
return 1;
}
Alles anzeigen
Ich habe einfach mal
else if(PlayerInfo[playerid][pMember] == 4||PlayerInfo[playerid][pLeader] == 4)
{
format(string, sizeof(string), "[Medic %s:o< %s]", sendername, result);
ProxDetector(60.0, playerid, string,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
}
eingefügt weil es mir recht logisch vorkam. Es hat aber nicht geklappt.
Bitte um Hilfe