SA-MP Forums Archive
Need Help! - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Need Help! (/showthread.php?tid=111430)



Need Help! - Ironboy500 - 01.12.2009

ok can anyone look at it and fix it for me:
here is start of script:
Код:
// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT

#include <a_samp>
#include <dini>
#include <dudb>
#pragma unused ret_memcpy

new IsLogged[MAX_PLAYERS];
enum pInfo
{
	AdminLevel,
     Cash,
     VIP,
     Banned,
     Kills,
     Deaths,
}
new PlayerInfo[MAX_PLAYERS][pInfo];

#if defined FILTERSCRIPT

#define COLOR_RED 0xFF0000FF
#define COLOR_ORANGE 0xFFA500FF
#define COLOR_YELLOWGREEN 0x9ACD32FF
#define COLOR_GREEN 0x008000FF
#define COLOR_AQUA 0x00FFFFFF
#define COLOR_GRAY 0x808080FF

public OnFilterScriptInit()
{
	print("\n--------------------------------------");
	print("Admin FilterScript by Ironboy500[MQ]");
	print("--------------------------------------\n");
	return 1;
}

public OnFilterScriptExit()
{
	return 1;
}

#else

main()
{
	print("\n----------------------------------");
	print(" Blank Gamemode by your name here");
	print("----------------------------------\n");
}

#endif

public OnGameModeInit()
{
	// Don't use these lines if it's a filterscript
	return 1;
}

public OnGameModeExit()
{
	return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
	SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
	SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
	SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
	return 1;
}

public OnPlayerConnect(playerid)
{
	return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
  IsLogged[playerid] = 0;
	return 1;
}

public OnPlayerSpawn(playerid)
{
  if(PlayerInfo[playerid][VIP] = 1)
  SetPlayerArmour (playerid, 0);

	return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
  PlayerInfo[playerid][Deaths]++;
	if(IsPlayerConnected(killerid) && killerid != INVALID_PLAYER_ID)
	{
	PlayerInfo[killerid][Kills]++;
	}
	return 1;
}
and error:

Quote:

I:\Mini-Quests\filterscripts\AdminFilterScript.pwn(87) : warning 211: possibly unintended assignment
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Warning.

Error line is on "if(PlayerInfo[playerid][VIP] = 1)"!
Thanks


Re: Need Help! - diesulke - 01.12.2009

Try:

pawn Код:
if(pInfo[playerid][VIP] = 1)



Re: Need Help! - -xy! - 01.12.2009

Quote:
Originally Posted by diesulke
Try:

pawn Код:
if(pInfo[playerid][VIP] = 1)
Wrong.
Try:

pawn Код:
if(PlayerInfo[playerid][VIP] == 1)