Skip 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.

warning in mijn /freeze /unfreeze en /kick

Ik krijg de heletijd deze warn bij /freeze /unfreeze en /kick. Aangezien deze cmd's op maar een paar regels verschillen en de zelfde bases hebben post ik alleen /freeze.

mijn /freeze is gebaseerd op de /freeze in dit topic http://www.gtaforum.nl/index.php?showtopic=91984

Dit is de warning:

C:\Users\Jordi\Desktop\server samp\gamemodes\mijnscript.pwn(816) : warning 219: local variable "string" shadows a variable at a preceding level

regel 816 is dat stukje new string[256] hier beneden in het commandl

//----------------------------------[Freeze lvl 1+]------------------------------------------------
if(strcmp(cmd, "/freeze", true)==0)
{
	new giveplayerid;
	new pName[MAX_PLAYER_NAME];
	new opName[MAX_PLAYER_NAME];
	new string[256];
	GetPlayerName(playerid, pName, sizeof(pName));
	GetPlayerName(giveplayerid, opName, sizeof(opName));
	tmp = strtok(cmdtext, idx);
	if(adminlevel[playerid] > 1)
	if(!strlen(tmp))
	{
			SendClientMessage(playerid, COLOR_RED, "USAGE: /freeze [ID]");
			return 1;
	}
	giveplayerid = strval(tmp);
	if(!IsPlayerConnected(giveplayerid))
	{
			SendClientMessage(playerid, 0xFF0000AA, "Player not found"); return 1;
	}
	if(adminlevel[playerid] > 1)
	{
	TogglePlayerControllable(giveplayerid, 0);
	format(string, sizeof(string), "*** Admin %s freezed player %s!!!", pName, opName);
	SendClientMessageToAll(COLOR_RED, string);
	}
	if(adminlevel[playerid] == 0)
	{
	SendClientMessage(playerid, COLOR_RED, "You are not an admin!")
	}
	return 1;
}

PS. alles werkt wel maar ik wil van die rot warning tijdens compillen af.

Edited by jorD1

Featured Replies

Ik denk dat als je

new string[256];

verwijderd, het probleem opgelost moet zijn :)

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.

Account

Navigation

Search

Search

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.