21.09.2018, 09:40
Can someone tell me why this doesn't work?
I do /phone sms 61333 (my ig phone number) test and doesn't work. No messages or anything.
pawn Код:
if(!strcmp(sub_cmd, "sms"))
{
new targetid, number, text[128];
if (sscanf(params, "ds[128]", number, text)) return SCM(playerid, COLOR_LIGHTRED, "* [USAGE]: /phone sms [phone number] [message]");
if (!number) return SCM(playerid, COLOR_LIGHTRED, "* The specified phone number is not in service.");
//if (targetid == playerid) return SCM(playerid, COLOR_LIGHTRED, "* You can't text yourself.");
if (Player[targetid][PhoneStatus] == 0) return SCM(playerid, COLOR_LIGHTRED, "* The recipient has their phone powered OFF.");
if ((targetid = GetNumberOwner(number)))
{
GivePlayerMoney(playerid, -1);
SetMoneyInfo(playerid, 1, false, 2000);
ShowPlayerFooter(playerid, "You've been ~r~charged~w~ $1 to send a text.");
SendClientMessageEx(targetid, COLOR_YELLOW, "[TEXT]: %s - %s (%d)", text, ReturnName(playerid, 0), Player[playerid][PhoneNumber]);
SendClientMessageEx(playerid, COLOR_YELLOW, "[TEXT]: %s - %s (%d)", text, ReturnName(playerid, 0), Player[playerid][PhoneNumber]);
PlayerPlaySound(targetid, 1057, 0.0, 0.0, 0.0);
SendNearbyMessage(playerid, 30.0, COLOR_PURPLE, "* %s takes out %s phone and sends a text.", ReturnName(playerid, 0), CheckSex(playerid));
}