Help please advertise /ad
#1

I want to put the/ad, cnn before it comes the announcement of all server admins appear and if something is wrong you can give/cancel ad
Reply
#2

someone help me please
Reply
#3

i have in GM this :
else if(strcmp(x_job,"ad",true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(gPlayerLogged[playerid] == 0)
{
SendClientMessage(playerid, COLOR_GREY, " You need to login first !");
return 1;
}
if(PlayerInfo[playerid][pAdmin] > 0 || PlayerInfo[playerid][pHelper] > 0)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GREY, "Syntax: /cancel ad <PlayerID/PartOfName><Reason>");
return 1;
}
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new reason[64];
while ((idx < length) && ((idx - offset) < (sizeof(reason) - 1)))
{
reason[idx - offset] = cmdtext[idx];
idx++;
}
reason[idx - offset] = EOS;
if(!strlen(reason))
{
SendClientMessage(playerid, COLOR_GREY, "Synthax: /cancel ad <PlayerID/PartOfName> <Reason>");
return 1;
}
giveplayerid = ReturnUser(tmp);
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
if(PlayerNeedAD[giveplayerid] == 0)
{
SCM(playerid, COLOR_GREY, " This player not requested an advertisment");
return 1;
}
if(allowedlsad[giveplayerid] == 1)
{
allowedlsad[giveplayerid] = 0;
new executatul[MAX_PLAYER_NAME];
new adminul[MAX_PLAYER_NAME];
new string[256];
PlayerNeedAD[giveplayerid] = 0;
LSadsent = 0;
PlayerInfo[giveplayerid][pAD] = 0;
GetPlayerName(giveplayerid, executatul, sizeof(executatul));
GetPlayerName(giveplayerid, adminul, sizeof(adminul));
format(string, sizeof(string),"Administrator %s canceled your advertisment, reason: %s",adminul,reason);
SCM(giveplayerid, COLOR_LIGHTRED, string);
format(string, sizeof(string),"AdmCmd: %s canceled his %s's advertisment, reason: %s", adminul,executatul,reason);
ABroadCast(COLOR_LIGHTRED, string, 1);
OnPlayerUpdate(giveplayerid);
}
if(allowedlvad[giveplayerid] == 1)
{
allowedlvad[giveplayerid] = 0;
new executatul[MAX_PLAYER_NAME];
new adminul[MAX_PLAYER_NAME];
new string[256];
PlayerNeedAD[giveplayerid] = 0;
LVadsent = 0;
PlayerInfo[giveplayerid][pAD] = 0;
GetPlayerName(giveplayerid, executatul, sizeof(executatul));
GetPlayerName(giveplayerid, adminul, sizeof(adminul));
format(string, sizeof(string),"Administrator %s canceled your advertisment, reason: %s",adminul,reason);
SCM(giveplayerid, COLOR_LIGHTRED, string);
format(string, sizeof(string),"AdmCmd: %s canceled his %s's advertisment, reason: %s", adminul,executatul,reason);
ABroadCast(COLOR_LIGHTRED, string, 1);
OnPlayerUpdate(giveplayerid);
}
}
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " You are not an admin ! ");
return 1;
}
}
return 1;
}

AND THIS HAVE ERROR..( >>>>
D:\Server\Ownership\Server\gamemodes\red1.pwn(4946 : error 017: undefined symbol "PlayerNeedAD"
D:\Server\Ownership\Server\gamemodes\red1.pwn(4946 : warning 215: expression has no effect
D:\Server\Ownership\Server\gamemodes\red1.pwn(4946 : error 001: expected token: ";", but found "]"
D:\Server\Ownership\Server\gamemodes\red1.pwn(4946 : error 029: invalid expression, assumed zero
D:\Server\Ownership\Server\gamemodes\red1.pwn(4946 : fatal error 107: too many error messages on one line
Reply
#4

Have you tried Defining "PlayerNeedAD" at the top of your script next to the other #defines?

hope this helps
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)