if(strcmp(cmd, "/had", true) == 0 strcmp(cmd, "/had", true) == 0)
{
if(IsPlayerInFrac(playerid,8))
{
if(IsPlayerConnected(playerid))
{
if(gPlayerLogged[playerid] == 0)
{
SendClientMessage(playerid, COLOR_GREY, " Du bist noch nicht eingeloggt !");
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 , Kontakt: TheHitman",result);
OOCNews(TEAM_GROVE_COLOR,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 bist kein Hitman.");
return 1;
}
if(strcmp(cmd, "/had", true) == 0 || strcmp(cmd, "/had", true) == 0){
if(IsPlayerInFrac(playerid,8)) {
if(IsPlayerConnected(playerid)) { if(gPlayerLogged[playerid] == 0) { SendClientMessage(playerid, COLOR_GREY, " Du bist noch nicht eingeloggt !"); 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 , Kontakt: TheHitman",result); OOCNews(TEAM_GROVE_COLOR,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 bist kein Hitman."); return 1; }