How can i combine this
#1

i m maaking advert command i mean /vadvert with phone number
this is my number command
Код:
CMD:mynumber(playerid, params[])
{
	new playername[25], string[256];
	if (playeritems[playerid][ITEM_TYPE_CELLPHONE] == -1) return SendClientMessage2(playerid, COLOR_WHITE, "You do not own a cellphone.");
	GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
	format(string, 50, "C_%s", playername);
	format(string, 64, "Your number: %d", dini_Int(AddDirFile(dir_cellfiles, string), "number"));
	SendClientMessage2(playerid, COLOR_ORANGE, string);
	return 1;
}
and this is my advert command

Код:
CMD:ad(playerid, params[])
{
	new name[MAX_PLAYER_NAME], str[1000], tex[1000];
	if(!vipmember[playerid] && GetPlayerMoney(playerid) < 1000) return SendClientMessage(playerid, COLOR_RED, "You Need At Least $1000 To Advertise.");
	if(sscanf(params, "s", tex)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /ad [Message]");
	GetPlayerName(playerid, name, sizeof(name));
	format(str, sizeof(str), "[ADVERT]:%s: %s", name, tex);
	SendClientMessageToAll(COLOR_ORANGE, str);
	if(!vipmember[playerid]){GivePlayerMoney(playerid, -1000);}
	printf("[ADVERT]:%s:%s", name, tex);
	return 1;
}
i want to make this both in 1

like
when i do /ad it show me like this [VIP ADVERT] SILVER: Message (number of cellphone here)
anyone help me and get rep pls
Reply
#2

Код:
CMD:ad(playerid, params[])
{
	new string[52],name[MAX_PLAYER_NAME], str[1000], tex[1000];
	if(!vipmember[playerid] && GetPlayerMoney(playerid) < 1000) return SendClientMessage(playerid, COLOR_RED, "You Need At Least $1000 To Advertise.");
	if(sscanf(params, "s", tex)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /ad [Message]");
	GetPlayerName(playerid, name, sizeof(name));

	if (playeritems[playerid][ITEM_TYPE_CELLPHONE] == -1)
	{
format(str, sizeof(str), "[ADVERT]:%s: %s", name, tex);
}
else
{
format(string, 50, "C_%s", name);
format(str, sizeof(str), "[ADVERT]:%s: %s %d", name, tex, dini_Int(AddDirFile(dir_cellfiles, string), "number"));
}
	
	SendClientMessageToAll(COLOR_ORANGE, str);
	if(!vipmember[playerid]){GivePlayerMoney(playerid, -1000);}
	printf("[ADVERT]:%s:%s", name, tex);
	return 1;
}
If the player has phone number, it will show it
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)