Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- YCMD:ad(playerid, params[], help) {
- if(AdTimer[playerid] != 0) return SCM(playerid, COLOR_LGREEN, "Ai pus un anunt recent. Foloseste comanda /myad pentru a-l vedea.");
- new string[264],sendername[25],idx, str[184];
- if(!PlayerInfo[playerid][pPhone]) return SCM(playerid, COLOR_LGREEN, "Nu ai un telefon.");
- if(PlayerInfo[playerid][pMuted] == 1) {
- format(string, sizeof(string), "Nu poti folosi chatul deoarece ai mute. (%d seconds)",PlayerInfo[playerid][pMuteTime]);
- SCM(playerid, COLOR_GREY, string);
- return 1;
- }
- if(PlayerInfo[playerid][pLevel] < 5) return SCM(playerid, COLOR_GREY, "Ai nevoie de nivel 5 pentru a da un anunt!");
- GetPlayerName(playerid, sendername, sizeof(sendername));
- new length = strlen(params);
- while ((idx < length) && (params[idx] <= ' ')) idx++;
- new offset = idx, result[264];
- while ((idx < length) && ((idx - offset) < (sizeof(result) - 1))) {
- result[idx - offset] = params[idx];
- idx++;
- }
- result[idx - offset] = EOS;
- new totalads = TotalAds()+1;
- new adtimer;
- new payout = BizzInfo[14][bFee];
- new payout2 = BizzInfo[33][bFee];
- new payout3 = BizzInfo[34][bFee];
- if(!IsAtCNN(playerid)) return SCM(playerid, -1, "Eroare: Nu esti la un CNN!");
- if(!strlen(result)) return SCM(playerid, COLOR_GREY, "Sintaxa: {FFFFFF}/ad <Text>");
- if(FaceReclama(result)) return Reclama(playerid, result);
- if(IsAtCNN(playerid)) {
- if(payout)
- {
- if(IsPlayerInRangeOfPoint(playerid, 5.0, 1111.2168,-1796.9795,16.5938)) {
- if(GetPlayerCash(playerid) < payout) {
- format(string, sizeof(string), "* Ai folosit %d caractere si anuntul costa $%s, Nu ai banii necesari", offset, FormatNumber(payout));
- SCM(playerid, COLOR_WHITE, string);
- return 1;
- }
- GivePlayerCash(playerid, - payout);
- format(string, sizeof(string), "~r~Ai platit $%d~n~~w~Mesajul contine: %d caractere", payout, idx);
- GameTextForPlayer(playerid, string, 5000, 5);
- format(AdText[playerid], 256, result);
- format(string, sizeof(string), "Anunt publicat de %s ({FFFFFF}%d{00D900}): %s", GetName(playerid), playerid, result);
- SendStaffMessage(0x00D900FF, string);
- AdTimer[playerid] = totalads*60;
- adtimer = SetTimerEx("Advertisment", totalads*60000, 0, "d", playerid);
- SetPVarInt(playerid, "AdTimer", adtimer);
- format(string, sizeof(string), "Anuntul tau va fi afisat in %d minute (%d secunde).", AdTimer[playerid]/60, AdTimer[playerid]);
- SCM(playerid, -1, string);
- BizzInfo[14][bBalance] += payout;
- format(str,sizeof(str),"UPDATE 'bizz' SET `Till`='%d',`Products`='%d' WHERE `ID`='14'", BizzInfo[14][bBalance], BizzInfo[14][bProducts]);
- mysql_query(SQL,str);
- }
- }
- else if(payout2)
- {
- if(IsPlayerInRangeOfPoint(playerid, 5.0, -1942.8354,556.0744,35.1719)) {
- if(GetPlayerCash(playerid) < payout2) {
- format(string, sizeof(string), "* Ai folosit %d caractere si anuntul costa $%s, Nu ai banii necesari", offset, FormatNumber(payout2));
- SCM(playerid, COLOR_WHITE, string);
- return 1;
- }
- GivePlayerCash(playerid, - payout2);
- format(string, sizeof(string), "~r~Ai platit $%d~n~~w~Mesajul contine: %d caractere", payout2, idx);
- GameTextForPlayer(playerid, string, 5000, 5);
- format(AdText[playerid], 256, result);
- format(string, sizeof(string), "Anunt publicat de %s ({FFFFFF}%d{00D900}): %s", GetName(playerid), playerid, result);
- SendStaffMessage(0x00D900FF, string);
- AdTimer[playerid] = totalads*60;
- adtimer = SetTimerEx("Advertisment", totalads*60000, 0, "d", playerid);
- SetPVarInt(playerid, "AdTimer", adtimer);
- format(string, sizeof(string), "Anuntul tau va fi afisat in %d minute (%d secunde).", AdTimer[playerid]/60, AdTimer[playerid]);
- SCM(playerid, -1, string);
- BizzInfo[33][bBalance] += payout2;
- format(str,sizeof(str),"UPDATE 'bizz' SET `Till`='%d',`Products`='%d' WHERE `ID`='33'", BizzInfo[33][bBalance], BizzInfo[33][bProducts]);
- mysql_query(SQL,str);
- }
- }
- else if(payout3)
- {
- if(IsPlayerInRangeOfPoint(playerid, 5.0, 2078.6926,2045.8528,11.0579)) {
- if(GetPlayerCash(playerid) < payout3) {
- format(string, sizeof(string), "* Ai folosit %d caractere si anuntul costa $%s, Nu ai banii necesari", offset, FormatNumber(payout3));
- SCM(playerid, COLOR_WHITE, string);
- return 1;
- }
- GivePlayerCash(playerid, - payout3);
- format(string, sizeof(string), "~r~Ai platit $%d~n~~w~Mesajul contine: %d caractere", payout3, idx);
- GameTextForPlayer(playerid, string, 5000, 5);
- format(AdText[playerid], 256, result);
- format(string, sizeof(string), "Anunt publicat de %s ({FFFFFF}%d{00D900}): %s", GetName(playerid), playerid, result);
- SendStaffMessage(0x00D900FF, string);
- AdTimer[playerid] = totalads*60;
- adtimer = SetTimerEx("Advertisment", totalads*60000, 0, "d", playerid);
- SetPVarInt(playerid, "AdTimer", adtimer);
- format(string, sizeof(string), "Anuntul tau va fi afisat in %d minute (%d secunde).", AdTimer[playerid]/60, AdTimer[playerid]);
- SCM(playerid, -1, string);
- BizzInfo[34][bBalance] += payout3;
- format(str,sizeof(str),"UPDATE 'bizz' SET `Till`='%d',`Products`='%d' WHERE `ID`='34'", BizzInfo[34][bBalance], BizzInfo[34][bProducts]);
- mysql_query(SQL,str);
- }
- }
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement