Guten tag liebe Community.
Ich wollte machen also das mann nur an einem bestimmten Ort eine Ad machenb kann und das nur jede 60 Sek funktioniert aber nicht kann mir ja jemand helfen?
Mfg
if(strcmp(cmd, "/advertise", true) == 0 || strcmp(cmd, "/ad", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(gPlayerLogged[playerid] == 0)
{
if(IsPlayerInRangeOfPoint(playerid, 4.0, -2061.4827,2984.1594,45.6819))
{
SendClientMessage(playerid, COLOR_GREY, " Du bist nicht am AdPunkt an der Lost Angelz Base in Wilow Ranch!");
return 1;
}
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, "USAGE: (/ad)vertise [advert text]");
return 1;
}
if ((!adds) && (PlayerInfo[playerid][pAdmin] < 1))
{
format(string, sizeof(string), " Bitte warte %d bist zur nächsten Ad!", (addtimer/1000));
SendClientMessage(playerid, COLOR_GRAD2, string);
return 1;
}
new payout = idx * 25;
if(GetPlayerMoney(playerid) < payout)
{
format(string, sizeof(string), "* You used %d characters which cost $%d, you don't have enough.", offset, payout);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
return 1;
}
GivePlayerMoney(playerid, - payout);
SBizzInfo[7][sbTill] += payout;
ExtortionSBiz(7, payout);
format(string, sizeof(string), "Werbung: %s, Kontakt: %s Ph: %d", result, sendername,PlayerInfo[playerid][pPnumber]);
OOCNews(TEAM_GROVE_COLOR,string);
format(string, sizeof(string), "~r~Paid $%d~n~~w~Message contained: %d Characters", payout, idx);
GameTextForPlayer(playerid, string, 5000, 5);
if (PlayerInfo[playerid][pAdmin] < 1){SetTimer("AddsOn", addtimer, 0);adds = 0;}
}
return 1;
}
return 1;
}