Custom Made Phone system, saying un-existent number. :S
#7

Made this /pickup and /p to pickup and talk, but, when we do it, nothing show up to me, eigher to my partner.

pawn Код:
CMD:pickup(playerid, params[])
{
    if(PlayerInfo[playerid][Call] != 0)
    {
        new iTargetID = INVALID_PLAYER_ID;
        for (new i = 0; i < MAX_PLAYERS; i++)
        {
            if(PlayerInfo[i][Call] == PlayerInfo[playerid][PhoneNumber])
            {
                iTargetID = i;
                break;
            }
            if(iTargetID != INVALID_PLAYER_ID)
            {
                SendClientMessage(playerid, COLOR_LIGHTRED, "You picked up the call.");
                SendClientMessage(iTargetID, COLOR_LIGHTRED, "He picked up the call.");
            }
            return 1;
        }
        return 1;
    }
    else return SendClientMessage(playerid, COLOR_LIGHTRED, "No-one is calling you.");
}
CMD:p(playerid, params[])
{
    if(PlayerInfo[playerid][Call] != 0)
    {
        new iTargetID = INVALID_PLAYER_ID;
        for (new i = 0; i < MAX_PLAYERS; i++)
        {
            if(PlayerInfo[i][Call] == PlayerInfo[playerid][PhoneNumber])
            {
                iTargetID = i;
                break;
            }
            if(iTargetID != INVALID_PLAYER_ID)
            {
                new text[128], string[128];
                if(!sscanf(params, "s[128]", text))
                {
                    format(string, sizeof(string), "He says: %s", text);
                    SendClientMessage(iTargetID, COLOR_YELLOWGREEN, string);
                    format(string, sizeof(string), "You said: %s", text);
                    SendClientMessage(playerid, COLOR_GREEN, string);
                    return 1;
                }
                else return SendClientMessage(playerid, COLOR_LIGHTRED, "Usage: /p [Text]");
            }
            return 1;
        }
        return 1;
    }
    else return SendClientMessage(playerid, COLOR_LIGHTRED, "You are not in a call.");
}
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)