SA-MP Forums Archive
Chat spammed - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Chat spammed (/showthread.php?tid=307262)



Chat spammed - Gooday - 29.12.2011

Hi, when i enter the checpoints (I have info checpoints, when u enter u got a message) and when i enter one i see a both of all the checkpoints messages please help....

pawn Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
  if(pickupid == news)
  SendClientMessage(playerid, COLOR_GREY,"-------------------------------------------------------------------------------------------------");
  SendClientMessage(playerid, COLOR_LIGHTGREEN,"KAUFMAN CAB RECRUIMENT OFFICE");
  SendClientMessage(playerid, COLOR_GREY,"We are hiring new drivers! Type /TaxiJob for become a Kaufman's driver and start your work!");
  SendClientMessage(playerid, COLOR_GREY,"Use /R [Message] for comunicate with the other drivers. At every call you will see a message on your laptop.");
  SendClientMessage(playerid, COLOR_GREY,"-------------------------------------------------------------------------------------------------");
  if(pickupid == pw)
  SendClientMessage(playerid, COLOR_GREY,"-------------------------------------------------------------------------------------------------");
  SendClientMessage(playerid, COLOR_LIGHTGREEN,"BONE COUNTY PUBLIC WORKS RECRUIMENT OFFICE");
  SendClientMessage(playerid, COLOR_GREY,"We are hiring new workers! Type /PublicWorks for become a Public Worker and start your job!");
  SendClientMessage(playerid, COLOR_GREY,"Use /R [Message] for comunicate with the other workers.");
  SendClientMessage(playerid, COLOR_GREY,"-------------------------------------------------------------------------------------------------");
  if(pickupid == taxi)
  SendClientMessage(playerid, COLOR_GREY,"-------------------------------------------------------------------------------------------------");
  SendClientMessage(playerid, COLOR_LIGHTGREEN,"SAN ANDREAS NETWORK RECRUIMENT OFFICE");
  SendClientMessage(playerid, COLOR_GREY,"We are hiring new reporters! Type /SannJob for become a Reporter and start your Journalistc Career!");
  SendClientMessage(playerid, COLOR_GREY,"-------------------------------------------------------------------------------------------------");
    return 1;
}



Re: Chat spammed - Vince - 29.12.2011

Does that even compile? You need to use compound statements (i.e. curly brackets).


Re: Chat spammed - Gooday - 29.12.2011

i GOT NO wars when compile...please post a example....


Re: Chat spammed - seanny - 29.12.2011

pawn Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
  if(pickupid == news)
  {
    SendClientMessage(playerid, COLOR_GREY,"-------------------------------------------------------------------------------------------------");
    SendClientMessage(playerid, COLOR_LIGHTGREEN,"KAUFMAN CAB RECRUIMENT OFFICE");
    SendClientMessage(playerid, COLOR_GREY,"We are hiring new drivers! Type /TaxiJob for become a Kaufman's driver and start your work!");
    SendClientMessage(playerid, COLOR_GREY,"Use /R [Message] for comunicate with the other drivers. At every call you will see a message on your laptop.");
    SendClientMessage(playerid, COLOR_GREY,"-------------------------------------------------------------------------------------------------");
  }
  else if(pickupid == pw)
  {
    SendClientMessage(playerid, COLOR_GREY,"-------------------------------------------------------------------------------------------------");
    SendClientMessage(playerid, COLOR_LIGHTGREEN,"BONE COUNTY PUBLIC WORKS RECRUIMENT OFFICE");
    SendClientMessage(playerid, COLOR_GREY,"We are hiring new workers! Type /PublicWorks for become a Public Worker and start your job!");
    SendClientMessage(playerid, COLOR_GREY,"Use /R [Message] for comunicate with the other workers.");
    SendClientMessage(playerid, COLOR_GREY,"-------------------------------------------------------------------------------------------------");
  }
  else if(pickupid == taxi)
  {
    SendClientMessage(playerid, COLOR_GREY,"-------------------------------------------------------------------------------------------------");
    SendClientMessage(playerid, COLOR_LIGHTGREEN,"SAN ANDREAS NETWORK RECRUIMENT OFFICE");
    SendClientMessage(playerid, COLOR_GREY,"We are hiring new reporters! Type /SannJob for become a Reporter and start your Journalistc Career!");
    SendClientMessage(playerid, COLOR_GREY,"-------------------------------------------------------------------------------------------------");
  }
  return 1;



Re: Chat spammed - Luis- - 29.12.2011

How does that give no errors.


Re: Chat spammed - PowerPC603 - 29.12.2011

Try this:
pawn Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
    switch(pickupid)
    {
        case news:
        {
            SendClientMessage(playerid, COLOR_GREY,"-------------------------------------------------------------------------------------------------");
            SendClientMessage(playerid, COLOR_LIGHTGREEN,"KAUFMAN CAB RECRUIMENT OFFICE");
            SendClientMessage(playerid, COLOR_GREY,"We are hiring new drivers! Type /TaxiJob for become a Kaufman's driver and start your work!");
            SendClientMessage(playerid, COLOR_GREY,"Use /R [Message] for comunicate with the other drivers. At every call you will see a message on your laptop.");
            SendClientMessage(playerid, COLOR_GREY,"-------------------------------------------------------------------------------------------------");
        }
        case pw:
        {
            SendClientMessage(playerid, COLOR_GREY,"-------------------------------------------------------------------------------------------------");
            SendClientMessage(playerid, COLOR_LIGHTGREEN,"BONE COUNTY PUBLIC WORKS RECRUIMENT OFFICE");
            SendClientMessage(playerid, COLOR_GREY,"We are hiring new workers! Type /PublicWorks for become a Public Worker and start your job!");
            SendClientMessage(playerid, COLOR_GREY,"Use /R [Message] for comunicate with the other workers.");
            SendClientMessage(playerid, COLOR_GREY,"-------------------------------------------------------------------------------------------------");
        }
        case taxi:
        {
            SendClientMessage(playerid, COLOR_GREY,"-------------------------------------------------------------------------------------------------");
            SendClientMessage(playerid, COLOR_LIGHTGREEN,"SAN ANDREAS NETWORK RECRUIMENT OFFICE");
            SendClientMessage(playerid, COLOR_GREY,"We are hiring new reporters! Type /SannJob for become a Reporter and start your Journalistc Career!");
            SendClientMessage(playerid, COLOR_GREY,"-------------------------------------------------------------------------------------------------");
        }
    }

    return 1;
}



Re: Chat spammed - Norck - 29.12.2011

Quote:
Originally Posted by -Luis
Посмотреть сообщение
How does that give no errors.
Because braces are not necessary for a single instruction.