samp /pm command
#1

hello, anyone have /pm command?

need: /pm <phone_number> <text>

example /pm 18454844 <hello>

my phone number enum:

PlayerData[playerid][Numeris]
Reply
#2

You want to /pm people by phone number? You mean SMS, or am I just lost... ?
Reply
#3

yes sms /sms <phone_number> <text>
Reply
#4

bump
Reply
#5

You first have to work on a phone system that generates phone numbers for each player and saves it.
Then you create a variable to check if a player has a phone by fetching it from your library.
And if the player has a phone it'll call a certain number and if the number that the player entered is incorrect just respond to the player by saying that the phone number is invalid/incorrect.
Reply
#6

i have phone number system with random numbers
Reply
#7

lol the random numbers we can't do anything about it
Reply
#8

Well it is supposed to look something like this:

Код:
CMD:sms(playerid, params[])
{
	new string[128], text[128], number[50];
	if(sscanf(params, "ss[50]", number, text)) return SendClientMessage(playerid, -1, "USAGE: /SMS [Number] [Text]");
	else
	{	
		for(new i = 0; i < MAX_PLAYERS; i++)
		{
			if(!strcmp(number, pInfo[i][Number]))
			{
				format(string, sizeof(string), "SMS Sent to %s: %s", GetName(i), text);
				SendClientMessage(playerid, -1, string);

				format(string, sizeof(string), "SMS From %s: %s", GetName(playerid), text);
				SendClientMessage(i, -1, string);
			}
			else
			{
				SendClientMessage(playerid, -1, "**BEEP** It seems that number doesn't exist **BEEP**");
			}
		}

	}
	return 1;
}
It wasn't tested because I don't have a phone system on my script therefore it is UNTESTED anyways, MAKE SURE to replace if(!strcmp(number, pInfo[i][Number])) with YOUR variable that is used to fetch the targets number.

I hope this works and helped you.
Reply
#9

Quote:
Originally Posted by Ox1gEN
Посмотреть сообщение
Well it is supposed to look something like this:

Код:
CMD:sms(playerid, params[])
{
	new string[128], text[128], number[50];
	if(sscanf(params, "ss[50]", number, text)) return SendClientMessage(playerid, -1, "USAGE: /SMS [Number] [Text]");
	else
	{	
		for(new i = 0; i < MAX_PLAYERS; i++)
		{
			if(!strcmp(number, pInfo[i][Number]))
			{
				format(string, sizeof(string), "SMS Sent to %s: %s", GetName(i), text);
				SendClientMessage(playerid, -1, string);

				format(string, sizeof(string), "SMS From %s: %s", GetName(playerid), text);
				SendClientMessage(i, -1, string);
			}
			else
			{
				SendClientMessage(playerid, -1, "**BEEP** It seems that number doesn't exist **BEEP**");
			}
		}

	}
	return 1;
}
It wasn't tested because I don't have a phone system on my script therefore it is UNTESTED anyways, MAKE SURE to replace if(!strcmp(number, pInfo[i][Number])) with YOUR variable that is used to fetch the targets number.

I hope this works and helped you.
error 017: undefined symbol "GetName"
error 017: undefined symbol "GetName"

Idk how to script stock GetName(i)
Reply
#10

pawn Код:
CMD:sms(playerid, params[])
{
    new text[128], number;
    if(sscanf(params, "iz", number, text)) return SendClientMessage(playerid, -1, "USAGE: /SMS [Number] [Text]");
    else
    {  
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
            if(!strcmp(number, PlayerData[i][Numeris]))
            {
                                new string[128];
                format(string, sizeof(string), "SMS Sent to %s: %s", GetName(i), text);
                SendClientMessage(playerid, -1, string);

                format(string, sizeof(string), "SMS From %s: %s", GetName(playerid), text);
                SendClientMessage(i, -1, string);
            }
            else
            {
                SendClientMessage(playerid, -1, "**BEEP** It seems that number doesn't exist **BEEP**");
            }
        }

    }
    return 1;
}

stock GetName(playerid)
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, MAX_PLAYER_NAME);
return name;
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)