Alles funktioniert,
au0er das man statt einfach nur /news Test
/news Test 123 eingeben muss um die 123 zu sehen, also erst nach dem 2ten Leerzeichen kommt text.
if(strcmp(cmd, "/news", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pMember] == 9 || PlayerInfo[playerid][pLeader] == 9)
{
tmp = strtok(cmdtext, idx);
new tmpcar = GetPlayerVehicleID(playerid);
if(PlayerInfo[playerid][pMuted] == 1)
{
SendClientMessage(playerid, TEAM_CYAN_COLOR, "Du kannst nicht sprechen, du wurdest gemutet!");
return 1;
}
if(IsANRcar(tmpcar) || PlayerToPoint(5.0, playerid, 253.9280,69.6094,1003.6406))
{
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, "Tipp: /news [Nachrichtentext]");
return 1;
}
format(string, sizeof(string), "NR %s: %s", sendername, result);
OOCNews(COLOR_NEWS,string);
PlayerInfo[playerid][pNewsSkill] ++;
if(PlayerInfo[playerid][pNewsSkill] == 50)
{ SendClientMessage(playerid, COLOR_YELLOW, "* Your News Reporter Skill is now Level 2, soon you are able to Fly the News Chopper and talk Live."); }
else if(PlayerInfo[playerid][pNewsSkill] == 100)
{ SendClientMessage(playerid, COLOR_YELLOW, "* Your News Reporter Skill is now Level 3, soon you are able to Fly the News Chopper and talk Live."); }
else if(PlayerInfo[playerid][pNewsSkill] == 200)
{ SendClientMessage(playerid, COLOR_YELLOW, "* Your News Reporter Skill is now Level 4, you can fly the News Chopper now."); }
else if(PlayerInfo[playerid][pNewsSkill] == 400)
{ SendClientMessage(playerid, COLOR_YELLOW, "* Your News Reporter Skill is now Level 5, you can now talk Live with any person you want."); }
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Du bist nicht im Van !");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Du bist kein News Reporter !");
}
}
return 1;
}