24.02.2019, 00:20
i've got no ideea how to make this sms command work,please help,im new into this whole scripting thing.
CMDms(playerid,params[])
{
new message[128],string[128],string2[128],number,targetid;
foreach(Player, i)
{
number=PlayerInfo[i][pNumber];
}
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(PlayerInfo[targetid][pCellphone] == 0) return SendClientMessage(playerid, COLOR_GREY, " That player does not have a phone");
if(PlayerInfo[targetid][pCellphoneOnline] == 0) return SendClientMessage(playerid, COLOR_GREY, "That player has his phone turned off");
if(sscanf(params,"is[128]", number,message)) return SendClientMessage(playerid, COLOR_RED, "USAGE:{ffffff}/sms <number> <message>");
if(targetid == playerid) return SendClientMessage(playerid, COLOR_GREY, "You can't send a message to yourself");
format(string,sizeof(string),"From %s:%s",GetName(playerid),message);
SendClientMessage(targetid, COLOR_YELLOW, string);
format(string2,sizeof(string2),"To %s:%s",GetName(targetid),message);
SendClientMessage(playerid, COLOR_GREY, string2);
return 1;
}
I know i have to do some stock function in order to save every player's phone number in a variable or so i've heard,i dont know so please help
CMDms(playerid,params[])
{
new message[128],string[128],string2[128],number,targetid;
foreach(Player, i)
{
number=PlayerInfo[i][pNumber];
}
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(PlayerInfo[targetid][pCellphone] == 0) return SendClientMessage(playerid, COLOR_GREY, " That player does not have a phone");
if(PlayerInfo[targetid][pCellphoneOnline] == 0) return SendClientMessage(playerid, COLOR_GREY, "That player has his phone turned off");
if(sscanf(params,"is[128]", number,message)) return SendClientMessage(playerid, COLOR_RED, "USAGE:{ffffff}/sms <number> <message>");
if(targetid == playerid) return SendClientMessage(playerid, COLOR_GREY, "You can't send a message to yourself");
format(string,sizeof(string),"From %s:%s",GetName(playerid),message);
SendClientMessage(targetid, COLOR_YELLOW, string);
format(string2,sizeof(string2),"To %s:%s",GetName(targetid),message);
SendClientMessage(playerid, COLOR_GREY, string2);
return 1;
}
I know i have to do some stock function in order to save every player's phone number in a variable or so i've heard,i dont know so please help