Jump to content
  • 0

Problema /ad !


AlyN.

Question

Problema intalnita (descriere): se poate da ad dupa ad..nu este o limita de timp.Se poate sa ma ajutati?Multumsc. 

Ero(area / rile) / warning-(ul / urile):-

Liniile de cod / sursa / script-ul:

Comanda ad:

if(strcmp(cmd, "/advertise", true) == 0 || strcmp(cmd, "/ad", true) == 0)
{
   if(IsPlayerConnected(playerid))
   {
       if(gPlayerLogged[playerid] == 0)
       {
           SendClientMessage(playerid, COLOR_GREY, "[Eroare]: You havent logged in yet !");
           return 1;
       }
       if(PlayerInfo[playerid][pLevel] < 3)
       {
           SendClientMessage(playerid, COLOR_GREY, "[Eroare]: You have to be level 3 to use this function !");
           return 1;
       }
       if(!PlayerToPoint(3.0,playerid,867.8030,-1056.4480,3239.0859))
       {
           SendClientMessage(playerid, COLOR_GREY, "[Eroare]: You are not at Advertise studio !");
           return 1;
       }
            if(PlayerInfo[playerid][pAD] == 1)
{
SendClientMessage(playerid, TEAM_CYAN_COLOR, "[Eroare]: Esti banat pe /ad , data viitoare ai grija ce /ad dai.");
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(DetectSPAM(result)) /// Anti-Reclama2
{
new advertiser[MAX_PLAYER_NAME];
GetPlayerName(playerid, advertiser, sizeof(advertiser));
format(string, sizeof(string), "[AdmCmd]: %s was silenced 10 minute(s) by NT Bot, reason: [Server Advertising]",advertiser);
SendClientMessageToAll(COLOR_LIGHTRED,string);
PlayerInfo[playerid][pMuted] = 1;
PlayerInfo[playerid][pMuteTime] = 10*60;
KickLog(string);
  return 1;
  }
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "{00A1FF}USAGE{FFFFFF}: (/ad)vertise [advert text]");
return 1;
}
if ((!adds) && (PlayerInfo[playerid][pAdmin] < 1) && strcmp(sendername, "{FCRB}HeRo.",true) == 0)
{
format(string, sizeof(string), "[Eroare]: Please try again later %d seconds between Advertisements !",  (addtimer, 60));
SendClientMessage(playerid, COLOR_GRAD2, string);
return 1;
 
}
new payout = idx * 25;
if(GetPlayerMoney(playerid) < payout)
       {
           format(string, sizeof(string), "[Eroare]: You used %d characters which cost %s, you don't have enough.", offset, DecimalPoint(payout));
           SendClientMessage(playerid, COLOR_WHITE, string);
           return 1;
       }
SafeGivePlayerMoney(playerid, - payout);
SBizzInfo[7][sbTill] += payout;
ExtortionSBiz(7, payout/2);
format(string, sizeof(string), "[Advert] %s, Phone: %d, Name: %s",  result, PlayerInfo[playerid][pPnumber], sendername);
OOCNews(TEAM_GROVE_COLOR,string);
format(string, sizeof(string), "~r~Paid %s~n~~w~Message contained: %d Characters", DecimalPoint(payout), idx);
GameTextForPlayer(playerid, string, 5000, 1);
if (PlayerInfo[playerid][pAdmin] < 1){SetTimer("AddsOn", addtimer, 0);adds = 0;}
}
return 1;
}
Edited by AlyN.
Link to comment
Share on other sites

9 answers to this question

Recommended Posts

  • 0
if ((!adds) && (PlayerInfo[playerid][pAdmin] < 1) && strcmp(sendername, "{FCRB}HeRo.",true) == 0)
{
format(string, sizeof(string), "[Eroare]: Please try again later %d seconds between Advertisements !",  (addtimer, 60));

Este timer pus . Tu daca ai admin mai mare de 1 normal ca poti da fara limita .

  • Upvote 1
Link to comment
Share on other sites

  • 0

 

Merge si fara admin..

 

 

Verifica daca ai in gamemode functia AddsOn , daca nu o ai adauga asa la inceputul gamemode-ului :

forward AddsOn();

si undeva pe la sfarsitul gamemode-ului adauga :

public AddsOn()
{
adds=1;
return 1;
 
}

Apoi verifica daca in gamemode ai indicat cate minute sa astept un player dupa un /ad , cauta addtimer = 60000 si daca nu ai adauga asa pe la inceputul gamemode-ului :

new addtimer = 60000;
Edited by NoNamed
  • Upvote 1
Link to comment
Share on other sites

  • 0

Ce nume folosesti pe server ? Acela cu [FCRB] la inceput ?

 

Incearca sa o inlocuiesti cu comanda asta, si daca merge ii modifici tu aspectul cum doresti , daca nici cu asta nu merge inseamna ca nu stii tu sa incerci comanda ... :


if(strcmp(cmd, "/advertise", true) == 0 || strcmp(cmd, "/ad", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
	        if(gPlayerLogged[playerid] == 0)
	        {
	            SendClientMessage(playerid, COLOR_GREY, "You havent logged in yet !");
	            return 1;
	        }
	        if(PlayerInfo[playerid][pLevel] < 5)
	        {
         		SendClientMessage(playerid, 0x4FA7FFFF, "*** You must be level 5 to use /ad");
	            return 1;
	        }
	        if(PlayerInfo[playerid][pMuted] == 1)
			{
				SendClientMessage(playerid, TEAM_CYAN_COLOR, "   You can't speak, you have been silenced !");
				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;
			result[0] = toupper(result[0]);
			if(!strlen(result))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "USAGE: (/ad)vertise [advert text]");
				return 1;
			}
			if ((!adds) && (PlayerInfo[playerid][pAdmin] < 1))
			{
				format(string, sizeof(string), "   Please try again later %d seconds between Advertisements !",  (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;
	        }
	        if(FindIP(result)) /// Anti-Reclama
   			{
				SendClientMessage(playerid, COLOR_RED, "You have kicked for Guardian , because you write an IP Adrees.");
				new advertiser[MAX_PLAYER_NAME];
				GetPlayerName(playerid, advertiser, sizeof(advertiser));
				format(string, sizeof(string), "PGLE Bot: {FFFF00}%s was kicked with reason: Write an IP Adreess (Reclama)",advertiser);
				SendClientMessageToAll(COLOR_RED,string);
				KickLog(string);
				Kick(playerid);
				return 1;
			}
            if(anty(result) && PlayerInfo[playerid][pAdmin] == 0 && PlayerInfo[playerid][pHelper] == 0)
			{
            new advertiser[MAX_PLAYER_NAME];
			GetPlayerName(playerid, advertiser, sizeof(advertiser));
			format(string, sizeof(string), "PGLE Bot: {FFFF00}%s was kicked with reason: Reclama pe /ad",advertiser);
			SendClientMessageToAll(COLOR_RED,string);
			Kick(playerid);
			return 0;
			}
			if(PlayerInfo[playerid][pAdmin] == 0 || PlayerInfo[playerid][pHelper] == 0)
			    {
				    for(new i=0; i<MAX_ENTRY; i++)
					{
				 	    if(!Swear[0]) continue;
						Cenzura(result,Swear);
					}
				}
			GivePlayerMoney(playerid, - payout);
			SBizzInfo[7][sbTill] += payout;
			ExtortionSBiz(7, payout);
			format(string, sizeof(string), "[Advertisement]: %s, Contact: %s Ph: %d",  result, sendername,PlayerInfo[playerid][pPnumber]);
			OOCNews(0x00FF0096,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;
	}
  • Upvote 1
Link to comment
Share on other sites

  • 0

Bun,am inlocuit comanda cu comanda data de tine si acum am 7 erori

C:UsersMariusDesktopGM PERFECTxagamemodesJ2P.pwn(33238) : error 017: undefined symbol "FindIP"
C:UsersMariusDesktopGM PERFECTxagamemodesJ2P.pwn(33249) : error 017: undefined symbol "anty"
C:UsersMariusDesktopGM PERFECTxagamemodesJ2P.pwn(33260) : error 017: undefined symbol "MAX_ENTRY"
C:UsersMariusDesktopGM PERFECTxagamemodesJ2P.pwn(33262) : error 017: undefined symbol "Swear"
C:UsersMariusDesktopGM PERFECTxagamemodesJ2P.pwn(33262) : warning 215: expression has no effect
C:UsersMariusDesktopGM PERFECTxagamemodesJ2P.pwn(33262) : error 001: expected token: ";", but found "]"
C:UsersMariusDesktopGM PERFECTxagamemodesJ2P.pwn(33262) : error 029: invalid expression, assumed zero
C:UsersMariusDesktopGM PERFECTxagamemodesJ2P.pwn(33262) : fatal error 107: too many error messages on one line

Liniile sunt astea:

 

33238:       if(FindIP(result)) /// Anti-Reclama
33249:            if(anty(result) && PlayerInfo[playerid][pAdmin] == 0 && PlayerInfo[playerid][pHelper] == 0)
33260:   for(new i=0; i<MAX_ENTRY; i++)
33262:   if(!Swear[0]) continue;
Edited by AlyN.
Link to comment
Share on other sites

  • 0

Sterge 


if(FindIP(result)) /// Anti-Reclama
   			{
				SendClientMessage(playerid, COLOR_RED, "You have kicked for Guardian , because you write an IP Adrees.");
				new advertiser[MAX_PLAYER_NAME];
				GetPlayerName(playerid, advertiser, sizeof(advertiser));
				format(string, sizeof(string), "PGLE Bot: {FFFF00}%s was kicked with reason: Write an IP Adreess (Reclama)",advertiser);
				SendClientMessageToAll(COLOR_RED,string);
				KickLog(string);
				Kick(playerid);
				return 1;
			}
            if(anty(result) && PlayerInfo[playerid][pAdmin] == 0 && PlayerInfo[playerid][pHelper] == 0)
			{
            new advertiser[MAX_PLAYER_NAME];
			GetPlayerName(playerid, advertiser, sizeof(advertiser));
			format(string, sizeof(string), "PGLE Bot: {FFFF00}%s was kicked with reason: Reclama pe /ad",advertiser);
			SendClientMessageToAll(COLOR_RED,string);
			Kick(playerid);
			return 0;
			}
			if(PlayerInfo[playerid][pAdmin] == 0 || PlayerInfo[playerid][pHelper] == 0)
			    {
				    for(new i=0; i<MAX_ENTRY; i++)
					{
				 	    if(!Swear[0]) continue;
						Cenzura(result,Swear);
					}
				}

si iti va merge .

  • Upvote 1
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.