21.04.2018, 18:11
My question is
How to SCM if no phone number is avaible? (if i type 221 but no player with number 221 is online)
How to SCM if no phone number is avaible? (if i type 221 but no player with number 221 is online)
PHP код:
CMD:sms(playerid, params[])
{
new string[110], string2[110], name[MAX_PLAYER_NAME], number, text[80];
GetPlayerName(playerid, name, sizeof(name));
if(sscanf(params, "is[80]", number, text)) return SendClientMessage(playerid, 0xFFFFFFFF, "/sms [number] [text]");
if(strlen(text) > 80) return SendClientMessage(playerid, 0xFFFFFFFF, "No more than 80 characters!");
format(string, sizeof(string), ""COL_SMS" SMS: %s, | Sender: %d", text, number);
format(string2, sizeof(string2), ""COL_SMS" SMS: %s, | Sent to: %d", text, number);
foreach(new i: Player)
{
if(pInfo[i][Telefon] == number)
{
SendClientMessage(i,-1, string2);
SendClientMessage(i,-1, string);
break;
}
}
return true;
}