Need help ( /news )
#1

Hi, i need a command, it's /news, it's shows all update for the server ect..
Reply
#2

Post some code here if you've made an attempt

Simply use dialogs to show your news or whatever, text draw, gametext, dialogs
Reply
#3

Код:
// This command displays the rules of the server
COMMAND:news(playerid, params[])
{
	// Setup local variables
	new Msg[2000];

	// Send the command to all admins so they can see it
	SendAdminText(playerid, "/news", params);

	// Check if the player has logged in
	if (APlayerData[playerid][LoggedIn] == true)
	{
		// Construct the rules
		format(Msg, 2000, "%s1.----------------------------- Mise а jour V1.1 ----------------------------- .\n", Msg);
		format(Msg, 2000, "%s2. Ajout d'une nouvelle commande pour respawn son vйhicule, /resveh.\n", Msg);
		format(Msg, 2000, "%s3. Le mot de passe est maintenant invisible quand vous le tapez.\n", Msg);
		format(Msg, 2000, "%s4. Ajouts de quelque missions pour les camionneurs.\n", Msg);
		format(Msg, 2000, "%s5. Ajout d'un ferry reliant entre Los Island et California island (initbrain).\n", Msg);
		format(Msg, 2000, "%s6. Un anti-spam pour le chat.\n", Msg);
		format(Msg, 2000, "%s7. Ajout d'un anti-ping, il kick les joueurs ayant un ping plus de 500.\n", Msg);
		format(Msg, 2000, "%s8. Ajout d'un Regulateur de vitesse.\n", Msg);
	    // Show a dialog that shows the rules
		ShowPlayerDialog(playerid, DialogRules, DIALOG_STYLE_MSGBOX, "Les news du serveur:", Msg, "Sortire", TXT_DialogButtonCancel);
	}
	else
	    return 0;
		// Let the server know that this was a valid command
	return 1;
}
is it good ?
Reply
#4

Dude remove everything from else , let the return 1 be...
Reply
#5

Quote:
Originally Posted by fuckingcruse
Посмотреть сообщение
Dude remove everything from else , let the return 1 be...
He's probably doing return 0 to give the unknown command-message if the player isn't an administrator.
But yeah it all seems fine.
Reply
#6

Wow dude he want the cmd to be used to all not only admin..
Reply
#7

Sorry i mean if the player isn't logged in.
Reply
#8

Quote:
Originally Posted by CalvinC
Посмотреть сообщение
Sorry i mean if the player isn't logged in.
// Check if the player has logged in
if (APlayerData[playerid][LoggedIn] == true)

All player's can see the cmd.
Reply
#9

Quote:
Originally Posted by Wassimo
Посмотреть сообщение
// Check if the player has logged in
if (APlayerData[playerid][LoggedIn] == true)

All player's can see the cmd.
I know that
pawn Код:
else
    return 0;
But you have a return 0 if he's not logged in, giving the unknown-command message which is fine to use if you want.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)