if(strcmp(cmd, "/advertise", true) == 0 || strcmp(cmd, "/ad", true) == 0)
{
if(PlayerInfo[playerid][pLevel] >= 3)
{
if(IsPlayerConnected(playerid))
{
if(gPlayerLogged[playerid] == 0)
{
SendClientMessage(playerid, COLOR_GREY, " Du bist noch nicht eingeloggt !");
return 1;
}
if(!IsPlayerInRangeOfPoint(playerid, 5.0, 1207.9789,-917.8524,43.0591) && !IsPlayerInRangeOfPoint(playerid, 5.0, 1207.9789,-917.8524,43.0591))
{
SendClientMessage(playerid, COLOR_GRAD1, "Du bist nicht am Burder Shot Nord(BSN)!");
return 1;
}
if(PlayerInfo[playerid][pGangJailed] == 1 || PlayerTied[playerid] >= 1)
{
SendClientMessage(playerid, COLOR_GRAD1, "Du kannst jetzt keine Werbung schreiben!");
return 1;
}
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[128];
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, "Benutzung: (/ad)vertise [text]");
return 1;
}
if ((!adds) && (PlayerInfo[playerid][pAdmin] < 1))
{
format(string, sizeof(string), "Bitte Versuch es Später wieder %d sekunden zwischen einer Werbung!", (addtimer/1000));
SendClientMessage(playerid, COLOR_GRAD2, string);
return 1;
}
new payout = idx * SBizzInfo[5][sbEntranceCost];
if(GetPlayerMoney(playerid) < payout)
{
format(string, sizeof(string), "* Du hast %d Zeichen benutzt, das kostet $%d, du hast nicht genug dabei.", offset, payout);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
return 1;
}
GivePlayerMoney(playerid, - payout);
SBizzInfo[5][sbTill] += payout/3;
ExtortionSBiz(5, payout);
format(string, sizeof(string), "Werbung: %s, Von: %s, PH: %d", result, sendername,PlayerInfo[playerid][pPnumber]);
OOCNews(0xFF8900FF,string);
format(string, sizeof(string), "~r~Rechnung: $%d~n~~w~Nachricht hatte: %d Zeichen.", payout, idx);
GameTextForPlayer(playerid, string, 5000, 5);
if (PlayerInfo[playerid][pAdmin] < 1){SetTimer("AddsOn", addtimer, 0);adds = 0;}
}
}
else SendClientMessage(playerid,COLOR_RED,"Du brauchst Level 3 um eine Werbung zu schreiben.");
return 1;
}