Chat spammed
#1

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;
}
Reply
#2

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

i GOT NO wars when compile...please post a example....
Reply
#4

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;
Reply
#5

How does that give no errors.
Reply
#6

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;
}
Reply
#7

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


Forum Jump:


Users browsing this thread: 1 Guest(s)