[HELP] /news command
#1

Hi , i have problem with command /news , i don't know how to make it like i want..

Код:
CMD:news(playerid, params[])
	{
	if(!PlayerInfo[playerid][pMember] == 3 || PlayerInfo[playerid][pLider] == 3) return SendClientMessage(playerid,-1,""CRVENA"ERROR: "ZELENA"Niste clan Bahamas Cable Network-a.");
	if(!IsPlayerInVehicle(playerid, 582)) return *SendClientMessage(playerid,-1,""CRVENA"ERROR: "ZELENA"Niste u vozilu Bahamas Cable Network-a.");
 * * * *if(sscanf(params, "s[128]", tekst)) return SendClientMessage(playerid, -1, ""CRVENA"Koriљtenje: "ZELENA"/news [tekst]");
 * * * *new newtext[128],tekst[128],name[MAX_PLAYER_NAME];
 * * * GetPlayerName(playerid, name, MAX_PLAYER_NAME);
 * * * format(newtext, sizeof(newtext), "Novinar %s: %s", name ,tekst);
 * * * TextDrawSetString(NEWS0, newtext);
 * * * TextDrawShowForAll(playerid, NEWS0);
 * * * return true;
	}
I made 3txd-s , and i want to make command,which will work like this:

example :


Quote:

Novinar Ime_Test : Good Afternoon
Novinar Ime_Test : My name is Ime_Test
Novinar Ime_Test : Welcome to los santos news.

and then "Good Afternoon" dissapears , and on his spot comes "my name is Ime_Test" , and when he type it again then "Welcome to Los santos news" goes on 2. positions , and My name is Ime_Test goes on 1. position, I hope you understand me.

Like this :


Quote:

Novinar Ime_Test : My name is Ime_Test
Novinar Ime_Test : Welcome to los santos news.
Novinar Ime_Test : Today the weather is....

Reply
#2

I know what you mean but don't know how to make it.
Just
pawn Код:
CMD:news(playerid, params[])
{
    if(PlayerInfo[playerid][pMember] !=3 || PlayerInfo[playerid][pLider] != 3) return SendClientMessage(playerid,-1,""CRVENA"ERROR: "ZELENA"Niste clan Bahamas Cable Network-a.");
    if(!IsPlayerInVehicle(playerid, 582)) return *SendClientMessage(playerid,-1,""CRVENA"ERROR: "ZELENA"Niste u vozilu Bahamas Cable Network-a.");
        if(sscanf(params, "s[128]", tekst)) return SendClientMessage(playerid, -1, ""CRVENA"Korištenje: "ZELENA"/news [tekst]");
        new newtext[128],tekst[128],name[MAX_PLAYER_NAME];
        GetPlayerName(playerid, name, MAX_PLAYER_NAME);
        format(newtext, sizeof(newtext), "Novinar %s: %s", name ,tekst);
        TextDrawSetString(NEWS0, newtext);
        TextDrawShowForAll(playerid, NEWS0);
        return 1;
}
I changed checking faction
Reply
#3

ty for check , i fixed check function
Reply
#4

Код:
if(strcmp(cmd, "/news", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
			if(PlayerInfo[playerid][pMember] == 9 || PlayerInfo[playerid][pLeader] == 9)
			{
			    new newcar = GetPlayerVehicleID(playerid);
		        if(PlayerInfo[playerid][pMuted] == 1)
				{
					SendClientMessage(playerid, COLOR_GREY, "   You cannot speak, you have been silenced !");
					return 1;
				}
    
				GetPlayerName(playerid, sendername, sizeof(sendername));
				new length = strlen(cmdtext);
				while ((idx < length) && (cmdtext[idx] <= ' '))
				{
					idx++;
				}
				new offset = idx;
				new result[96];
				while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
				{
					result[idx - offset] = cmdtext[idx];
					idx++;
				}
				result[idx - offset] = EOS;
				if(!strlen(result))
				{
					SendClientMessage(playerid, COLOR_WHITE, "USAGE: /news [newstext]");
					return 1;
				}
				format(string, sizeof(string), "NR %s: %s", sendername, result);
				OOCNews(COLOR_NEWS,string);
				PlayerInfo[playerid][pNewsSkill] ++;
				if(PlayerInfo[playerid][pNewsSkill] == 50)
				{ SendClientMessage(playerid, COLOR_YELLOW, "* Your News Reporter Skill is now Level 2, soon you are able to Fly the News Chopper and talk Live."); }
				else if(PlayerInfo[playerid][pNewsSkill] == 100)
				{ SendClientMessage(playerid, COLOR_YELLOW, "* Your News Reporter Skill is now Level 3, soon you are able to Fly the News Chopper and talk Live."); }
				else if(PlayerInfo[playerid][pNewsSkill] == 200)
				{ SendClientMessage(playerid, COLOR_YELLOW, "* Your News Reporter Skill is now Level 4, you can fly the News Chopper now."); }
				else if(PlayerInfo[playerid][pNewsSkill] == 400)
				{ SendClientMessage(playerid, COLOR_YELLOW, "* Your News Reporter Skill is now Level 5, you can now talk Live with any person you want."); }
			}
			else
			{
			    SendClientMessage(playerid, COLOR_GREY, "   You are not a News Reporter !");
			}
		}
		return 1;
	}
Reply
#5

Quote:
Originally Posted by Leo_Johnson
Посмотреть сообщение
Код:
if(strcmp(cmd, "/news", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
			if(PlayerInfo[playerid][pMember] == 9 || PlayerInfo[playerid][pLeader] == 9)
			{
			    new newcar = GetPlayerVehicleID(playerid);
		        if(PlayerInfo[playerid][pMuted] == 1)
				{
					SendClientMessage(playerid, COLOR_GREY, "   You cannot speak, you have been silenced !");
					return 1;
				}
    
				GetPlayerName(playerid, sendername, sizeof(sendername));
				new length = strlen(cmdtext);
				while ((idx < length) && (cmdtext[idx] <= ' '))
				{
					idx++;
				}
				new offset = idx;
				new result[96];
				while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
				{
					result[idx - offset] = cmdtext[idx];
					idx++;
				}
				result[idx - offset] = EOS;
				if(!strlen(result))
				{
					SendClientMessage(playerid, COLOR_WHITE, "USAGE: /news [newstext]");
					return 1;
				}
				format(string, sizeof(string), "NR %s: %s", sendername, result);
				OOCNews(COLOR_NEWS,string);
				PlayerInfo[playerid][pNewsSkill] ++;
				if(PlayerInfo[playerid][pNewsSkill] == 50)
				{ SendClientMessage(playerid, COLOR_YELLOW, "* Your News Reporter Skill is now Level 2, soon you are able to Fly the News Chopper and talk Live."); }
				else if(PlayerInfo[playerid][pNewsSkill] == 100)
				{ SendClientMessage(playerid, COLOR_YELLOW, "* Your News Reporter Skill is now Level 3, soon you are able to Fly the News Chopper and talk Live."); }
				else if(PlayerInfo[playerid][pNewsSkill] == 200)
				{ SendClientMessage(playerid, COLOR_YELLOW, "* Your News Reporter Skill is now Level 4, you can fly the News Chopper now."); }
				else if(PlayerInfo[playerid][pNewsSkill] == 400)
				{ SendClientMessage(playerid, COLOR_YELLOW, "* Your News Reporter Skill is now Level 5, you can now talk Live with any person you want."); }
			}
			else
			{
			    SendClientMessage(playerid, COLOR_GREY, "   You are not a News Reporter !");
			}
		}
		return 1;
	}
He already fixed it. However, he uses ZCMD not Strcmp.
Reply
#6

You need to change the PLeader - PMember to 3 or w/e is it in ur GM
Reply
#7

I don't know what you want but you can use FS ActuNews (in my signatuee) to announce the news of the server like a new ip, ts, forum link etc... The players will see te news before each connection.
Reply
#8

Quote:
Originally Posted by Kostas'
Посмотреть сообщение
He already fixed it. However, he uses ZCMD not Strcmp.
i fixed only check for organisation id


@Mehdi

this is for News Reporters..

@Leo

this is strcmp and scm, and i am using zcmd and command in textdraw..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)