Need small help for cmd
#1

Need small help to correct this, because it seems like it's working fine, but actually
it doesn't work fine.
pawn Код:
if(strcmp(cmdtext, "/work", true) == 0)
{
    if(gTeam[playerid] != 2) return SendClientMessage(playerid, COLOR_GREY, "You're not the carrier");
    }
    if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 440)
            {
            if(gTeam[playerid] ==  2)
            SendClientMessage(playerid, COLOR_GREY, "You've started the job, go and pick up the goods");
            Ccp[playerid] = 1;
            SetPlayerCheckpoint(playerid,120.403518, -294.375122, 1.578125, 3.0);
            }
            else
            {
            SendClientMessage(playerid, COLOR_GREY, "You are not in the truck!");
            return 1;
}
    return 1;

}
Reply
#2

pawn Код:
if(strcmp(cmdtext, "/work", true) == 0)
{
    if(gTeam[playerid] != 2)
        return SendClientMessage(playerid, COLOR_GREY, "You're not the carrier");

    if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 440)
    {
        if(gTeam[playerid] ==  2)
        SendClientMessage(playerid, COLOR_GREY, "You've started the job, go and pick up the goods");
        Ccp[playerid] = 1;
        SetPlayerCheckpoint(playerid,120.403518, -294.375122, 1.578125, 3.0);
    }
    else
    {
        SendClientMessage(playerid, COLOR_GREY, "You are not in the truck!");
    }
    return 1;

}
Reply
#3

Can you tell me the actual problem? Like what is wrong with it
Reply
#4

Quote:
Originally Posted by Cxnnor
Посмотреть сообщение
Can you tell me the actual problem? Like what is wrong with it
You didn't put bracket after SendClientMessage
pawn Код:
else
{
SendClientMessage(playerid, COLOR_GREY, "You are not in the truck!");
It must be like this
pawn Код:
else
{
    SendClientMessage(playerid, COLOR_GREY, "You are not in the truck!");
}
Reply
#5

Yup, thanks WagnerPm for clearing this out.
@Cxnnor, it was giving the player 5 messages about that he was not in the truck, when entering the truck.
All in all, it was a mess.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)