/sms command help
#8

pawn Код:
foreach(Player, i)
{
    number=PlayerInfo[i][pNumber];
}
This makes no sense, assigning value pNumber of the latest player connected, to the variable number.

pawn Код:
CMD:sms(playerid,params[])
{  
    new message[128], string[128], number;

    if(PlayerInfo[playerid][pCellphone] == 0) return SendClientMessage(playerid, COLOR_GREY, "You don't own a phone");
    if(PlayerInfo[playerid][pCellphoneOnline] == 0) return SendClientMessage(playerid, COLOR_GREY, " Your phone is turned off");

    if(sscanf(params,"ds[128]", number, message)) return SendClientMessage(playerid, COLOR_RED, "USAGE:{ffffff}/sms <number> <message>");

    if(number == PlayerInfo[playerid][pNumber]) return SendClientMessage(playerid, COLOR_GREY, "You can't send a message to yourself");

    foreach(new i : Player)
    {
        if(PlayerInfo[i][pNumber] != number) continue;

        if(PlayerInfo[i][pCellphone] == 0)
            return SendClientMessage(playerid, COLOR_GREY, " That player does not have a phone");
           
        if(PlayerInfo[i][pCellphoneOnline] == 0)
            return SendClientMessage(playerid, COLOR_GREY, "That player has his phone turned off");

        format(string, sizeof(string), "From %s:%s", GetName(playerid), message);
        SendClientMessage(i, COLOR_YELLOW, string);
        format(string, sizeof(string), "To %s:%s", GetName(i), message);
        SendClientMessage(playerid, COLOR_GREY, string);
    }
    return 1;
}
Reply


Messages In This Thread
/sms command help - by bosmania - 24.02.2019, 00:20
Re: /sms command help - by bosmania - 24.02.2019, 00:44
Re: /sms command help - by TheToretto - 24.02.2019, 05:57
Re: /sms command help - by bosmania - 24.02.2019, 09:12
Re: /sms command help - by polygxn - 24.02.2019, 09:54
Re: /sms command help - by bosmania - 24.02.2019, 11:19
Re: /sms command help - by bosmania - 24.02.2019, 11:50
Re: /sms command help - by TheToretto - 24.02.2019, 12:17
Re: /sms command help - by bosmania - 24.02.2019, 12:30

Forum Jump:


Users browsing this thread: 1 Guest(s)