[HELP] Small Problem
#1

Hello..

I have a command, /service

But when someone types /service bus .. it does not sendclientmessage to the bus drivers..

pawn Код:
else if(strcmp(choice,"bus",true) == 0)
    {
        if(BusDrivers < 1)
        {
            SendClientMessageEx(playerid, COLOR_GREY, "   There are no bus drivers at the moment, try again later!");
            return 1;
        }
        if(TransportDuty[playerid] > 0)
        {
            SendClientMessageEx(playerid, COLOR_GREY, "   You can't call for a bus now!");
            return 1;
        }
        format(string, sizeof(string), "** %s is in need of a bus driver - use /accept bus to accept the call.", GetPlayerNameEx(playerid));
        SendJobMessage(14, TEAM_AZTECAS_COLOR, string);
        SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "* You have called for a bus driver, wait for a reply.");
        BusCall = playerid;
        PlayerInfo[playerid][pServiceTime] = 30;
        return 1;
    }
Thats the code for the /service bus..

This does not manage to reach the bus drivers
pawn Код:
format(string, sizeof(string), "** %s is in need of a bus driver - use /accept bus to accept the call.", GetPlayerNameEx(playerid));

Need anymore information, just leme know
Reply
#2

Consider showing your SendJobMessage stock or callback whatever it is and if you want to show that to all you can always use SendClientMessageToAll to send the message to all the players in the server.

-FalconX
Reply
#3

pawn Код:
public SendJobMessage(job, color, string[])
{
    foreach(Player, i)
    {
        if((PlayerInfo[i][pJob] == job || PlayerInfo[i][pJob2] == job) && JobDuty[i] == 1)
        {
            SendClientMessageEx(i, color, string);
        }
    }
}
Is that it?

Or is this it?

pawn Код:
forward SendJobMessage(job, color, string[]);
Reply
#4

pawn Код:
forward SendJobMessage(const string[]);
pawn Код:
public SendJobMessage(job, color, string[])
{
    foreach(Player, i)
    {
        if((PlayerInfo[i][pJob] == job || PlayerInfo[i][pJob2] == job) && JobDuty[i] == 1)
        {
            SendClientMessage(i, COLOR_LIGHTBLUE, string);
        }
    }
}
Reply
#5

Thank you!,

Do you know what the problem was? or is?
Reply
#6

SendClientMessageEX,you don't need the EX parameter if you're send a message to the player.

Also,the color was not defined.

And the "job" thing in the forward,you just dont need it,you've to just forward the string created before.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)