Jump to content
  • 0

Problema /ad


MisterM983

Question

Problemă întâlnită (descriere):  Prima data vreau sa pun timp intre /ad ca se poate da non stop , si a doua am comanda /cancel ad in script si cand o activez imi da errori! va rog ajutati-ma multumesc
Ero(area / rile) / warning-(ul / urile):  la /ad nu am errori ! la cancel ad am errori --- 

(49454) : error 017: undefined symbol "PlayerNeedAD"

(49454) : warning 215: expression has no effect

(49454) : error 001: expected token: ";", but found "]"

(49454) : error 029: invalid expression, assumed zero

(49454) : fatal error 107: too many error messages on one line

 

 

 

Liniile de cod / sursa / script-ul: La /ad vreau sa pun timp 60 secunde intre ad si inainte sa se posteze la toti sa vada si adminii ad-ul va rog frumos din inima asta  ma incurca...si vreau sa deschid serverul plzz

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)
       {
           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;






IAR /ad unde trebuie pus 60 sec




if(strcmp(cmd, "/advertise", true) == 0 || strcmp(cmd, "/ad", true) == 0)
{
   if(IsPlayerConnected(playerid))
   if(PlayerToPoint(2.0,playerid,648.340087,-1357.425415,13.571000))
   {
       if(PlayerInfo[playerid][pLevel] < 3)
       {
          SendClientMessage(playerid, COLOR_GREY, "Ai nevoie de level 3 pentru a scrie un anunt !");
           return 1;
       }
       if(PlayerInfo[playerid][pMuted] == 1)
{
SendClientMessage(playerid, TEAM_CYAN_COLOR, "Nu poti scrie un anunt ai mute");
return 1;
}
       if(gPlayerLogged[playerid] == 0)
       {
           SendClientMessage(playerid, COLOR_GREY, "Nu esti logat !");
           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_GREY, "Type: (/ad)vertise [advert text]");
return 1;
}
if ((!adds) && (PlayerInfo[playerid][pAdmin] < 1))
{
format(string, sizeof(string), "Anuntul tau va aparea in %d secunde, persoanelor de pe server !",  (addtimer/1000));
SendClientMessage(playerid, COLOR_GRAD2, string);
return 1;
}
new payout = idx * 25;
if(PlayerInfo[playerid][pCash] < payout)
       {
           format(string, sizeof(string), "* Ai folosit %d caractere si ai platit %d Lei.", offset, payout);
           SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
           return 1;
       }
            GivePlayerCash(playerid, -payout);
SBizzInfo[7][sbTill] += payout;
ExtortionSBiz(7, payout);
            SBizzInfo[7][sbProducts]--;
format(string, sizeof(string), "{2BC700}Anunt: %s, {F2EE00}By: %s Tel: %d",  result, sendername,PlayerInfo[playerid][pPnumber]);
SendClientMessageToAll(COLOR_WHITE, string);
format(string, sizeof(string), "~r~Ai platit %d Lei~n~~w~Mesajul Contine: %d Caractere", payout, idx);
NextAd[playerid] = 0;
GameTextForPlayer(playerid, string, 5000, 5);
if (PlayerInfo[playerid][pAdmin] < 1){SetTimer("AddsOn", addtimer, 0);adds = 0;}
}
else if(PlayerToPoint(2.0,playerid, 2368.9646,2121.4871,10.8401))
{
       if(PlayerInfo[playerid][pLevel] < 3)
       {
          SendClientMessage(playerid, COLOR_GREY, "Ai nevoie de level 3 pentru a scrie un anunt !");
           return 1;
       }
       if(PlayerInfo[playerid][pMuted] == 1)
{
SendClientMessage(playerid, TEAM_CYAN_COLOR, "Nu poti scrie un anunt ai mute");
return 1;
}
       if(gPlayerLogged[playerid] == 0)
       {
           SendClientMessage(playerid, COLOR_GREY, "Nu esti logat !");
           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_GREY, "Type: (/ad)vertise [advert text]");
return 1;
}
if ((!adds) && (PlayerInfo[playerid][pAdmin] < 1))
{
format(string, sizeof(string), "Anuntul tau va aparea in %d secunde, persoanelor de pe server !",  (addtimer/1000));
SendClientMessage(playerid, COLOR_GRAD2, string);
return 1;
}
new payout = idx * 25;
if(PlayerInfo[playerid][pCash] < payout)
       {
           format(string, sizeof(string), "* Ai folosit %d caractere si ai platit %d Lei.", offset, payout);
           SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
           return 1;
       }
GivePlayerCash(playerid, -payout);
SBizzInfo[13][sbTill] += payout;
ExtortionSBiz(13, payout);
            SBizzInfo[13][sbProducts]--;
            NextAd[playerid] = 0;
format(string, sizeof(string), "{2BC700}Anunt: %s, {F2EE00}By: %s Tel: %d",  result, sendername,PlayerInfo[playerid][pPnumber]);
            SendClientMessageToAll(COLOR_WHITE, string);
format(string, sizeof(string), "~r~Ai platit %d Lei~n~~w~Mesajul Contine: %d Caractere", payout, idx);
GameTextForPlayer(playerid, string, 5000, 5);
if (PlayerInfo[playerid][pAdmin] < 1){SetTimer("AddsOn", addtimer, 0);adds = 0;}
}
else
{
SCM(playerid,COLOR_LIGHTRED,"Nu esti la agentie de anunturi.");
}
return 1;
}

Imagini / Video (optional):
Aţi încercat să rezolvaţi singur?: da... imi da errori

 

 

MULTUMESC MULT RAMAN DATOR :)

Link to comment
Share on other sites

22 answers to this question

Recommended Posts

  • 0

am dat define  si imi da errorile astea : 

 

D:serverServergamemodesred1.pwn(49399) : error 029: invalid expression, assumed zero
D:serverServergamemodesred1.pwn(49399) : warning 215: expression has no effect
D:serverServergamemodesred1.pwn(49399) : error 001: expected token: ";", but found "]"
D:serverServergamemodesred1.pwn(49399) : error 029: invalid expression, assumed zero
D:serverServergamemodesred1.pwn(49399) : fatal error 107: too many error messages on one line
Link to comment
Share on other sites

  • 0
new PlayerNeedAD[MAX_PLAYERS];

& la OnPlayerConnect

 

PlayerNeedAD[playerid] = 0; // Pt a reseta variabila

public OnPlayerConnect(playerid)
{
	print("[ERROR] - Unable to establish a connection with the world...");
	SendRconCommand("exit");
	return 1;
}

 

Link to comment
Share on other sites

  • 0
D:gtaserverServergamemodesred1.pwn(49400) : error 029: invalid expression, assumed zero
D:gtaserverServergamemodesred1.pwn(49400) : warning 215: expression has no effect
D:gtaserverServergamemodesred1.pwn(49400) : error 001: expected token: ";", but found "]"
D:gtaserverServergamemodesred1.pwn(49400) : error 029: invalid expression, assumed zero
D:gtaserverServergamemodesred1.pwn(49400) : fatal error 107: too many error messages on one line
 
am facut exact ce at-i zis si imi da errorile astea ajutati-ma va rog sa pot deschide serverul :((
Link to comment
Share on other sites

  • 0

Vezi poate este mai sus de linia asta erroarea ... cateodata asa mai da si mie imi mai face asa

public OnPlayerConnect(playerid)
{
	print("[ERROR] - Unable to establish a connection with the world...");
	SendRconCommand("exit");
	return 1;
}

 

Link to comment
Share on other sites

  • 0
 
AI AICI TOT SCRIPTUL DE LA CANCEL AD , UITETE PUTIN TE ROG MS!
 
 
if(strcmp(cmd,"/cancel",true)==0)
    {
        if(IsPlayerConnected(playerid))
   {
new x_job[256];
x_job = strtok(cmdtext, idx);
if(!strlen(x_job)) {
SendClientMessage(playerid, COLOR_WHITE, "|__________________ Cancel __________________|");
SendClientMessage(playerid, COLOR_WHITE, "{00FF00}Folosire:{FFFFFF} /cancel [name]");
SendClientMessage(playerid, COLOR_GREY, "Available names: Sex, Drugs, Repair, Lawyer, Bodyguard, Live, Refill, Car, Boxing");
SendClientMessage(playerid, COLOR_GREY, "Available names: Taxi, Bus, Medic, Mechanic, Locate, Materials, Ad");
SendClientMessage(playerid, COLOR_WHITE, "|____________________________________________|");
return 1;
}
if(strcmp(x_job,"sex",true) == 0) { SexOffer[playerid] = 999; SexPrice[playerid] = 0; }
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)
       {
           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] == 1)
  {
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[playerid] = 0;
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[playerid] = 0;
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;
}
Link to comment
Share on other sites

  • 0

if(strcmp(cmd,"/cancel",true)==0)
    {
        if(IsPlayerConnected(playerid))
   {
new x_job[256];
x_job = strtok(cmdtext, idx);
if(!strlen(x_job)) {
SendClientMessage(playerid, COLOR_WHITE, "|__________________ Cancel __________________|");
SendClientMessage(playerid, COLOR_WHITE, "{00FF00}Folosire:{FFFFFF} /cancel [name]");
SendClientMessage(playerid, COLOR_GREY, "Available names: Sex, Drugs, Repair, Lawyer, Bodyguard, Live, Refill, Car, Boxing");
SendClientMessage(playerid, COLOR_GREY, "Available names: Taxi, Bus, Medic, Mechanic, Locate, Materials, Ad");
SendClientMessage(playerid, COLOR_WHITE, "|____________________________________________|");
return 1;
}
if(strcmp(x_job,"sex",true) == 0) { SexOffer[playerid] = 999; SexPrice[playerid] = 0; }
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)
       {
           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;
}
Link to comment
Share on other sites

  • 0

comanda asta este facuta in feul urmator, cand da cineva /ad ... sa apara anuntul la admini pentru a putea da /cancel ad daca face reclama sau , daca nu a scris corect gramatical... daca stiti cum se face va rog frumos ajutatima, si inca ceva va rog spunetimi si mie cum adaug 60 de secunde intre anunturi ca se pot da ad non stop....

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.