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; }
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; } I hope this works and helped you. |
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;
}