Jump to content
View in the app

A better way to browse. Learn more.

GTAGames.nl - De Nederlandse Grand Theft Auto Community!

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Bericht bij login van admin

Hallo

Ik wil een kleine functie maken die de tekst %s logged in as an admin naar iedereen in de server stuurt als er een admin inlogt door middel van /rcon login. Ik weet niet echt hoe ik hieraan moet beginnen.

Ik denk dat ik nodig heb:

  • De callback OnRconCommand
  • SendClientMessageToAll
  • GetPlayerName
  • string, etc.

Tot nu toe heb ik dit zonder errors/warnings, maar het werkt echt voor geen meter.

public OnRconCommand(cmd[])
{
{
new login;
	new str[256], pname[256];
	format(str, 256, "%s logged in as an admin", pname, cmd[login]);
	SendClientMessageToAll(COLOR_WHITE, str);
	return 1;
	}
}

Featured Replies

1. OnRconCommand is niet voor ingame rcon-commando's. Alleen voor commando's in de console.

2. OnRconCommand werkt niet in een gamemode, alleen in een filterscript

3. Ik betwijfel of het wel mogelijk is om te detecteren of een speler als admin inlogt.

(Het zou wel kunnen met via een omweg):

Bovenaan je script:

new IsLoggedIn[MAX_PLAYERS];

Bij OnGameModeInit:

SetTimer("CheckAdminLogin", 5000, 1);

Bij OnPlayerConnect:

IsLoggedIn[playerid] = 0;

Ergens anders in je script:

forward CheckAdminLogin();
public CheckAdminLogin()
{
for(new i; i<MAX_PLAYERS; i++)
{
	if(IsPlayerAdmin(i) && IsLoggedIn[i]==0)
	{
		new string[128], pname[MAX_PLAYER_NAME];
		GetPlayerName(i, pname, sizeof(pname));
		format(string, sizeof(string), "%s logged in as Admin", pname);
		SendClientMessageToAll(COLOR_WHITE, string);
		IsLoggedIn[i] = 1;
	}
}
}

  • Author

Bedankt :D

Het werkt perfect. Have a beer :bier:

Bedankt :D

Het werkt perfect. Have a beer :bier:

Lekker :puh:

Succes ermee ;)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

Recently Browsing 0

  • No registered users viewing this page.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.