/sms command help
#1

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
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)