OMG error when I compile PWN
#1

Код:
C:\Documents and Settings\Administrateur\Mes documents\SAMP\DMwaim.pwn(62) : error 017: undefined symbol "COLOR_YELLOW"
C:\Documents and Settings\Administrateur\Mes documents\SAMP\DMwaim.pwn(63) : error 017: undefined symbol "COLOR_GREEN"
C:\Documents and Settings\Administrateur\Mes documents\SAMP\DMwaim.pwn(64) : error 017: undefined symbol "udb_Exists"
C:\Documents and Settings\Administrateur\Mes documents\SAMP\DMwaim.pwn(65) : error 017: undefined symbol "COLOR_YELLOW"
C:\Documents and Settings\Administrateur\Mes documents\SAMP\DMwaim.pwn(66) : error 017: undefined symbol "udb_Exists"
C:\Documents and Settings\Administrateur\Mes documents\SAMP\DMwaim.pwn(67) : error 017: undefined symbol "COLOR_YELLOW"
C:\Documents and Settings\Administrateur\Mes documents\SAMP\DMwaim.pwn(70) : error 017: undefined symbol "plrIP"
C:\Documents and Settings\Administrateur\Mes documents\SAMP\DMwaim.pwn(71) : error 017: undefined symbol "plrIP"
C:\Documents and Settings\Administrateur\Mes documents\SAMP\DMwaim.pwn(72) : error 017: undefined symbol "COLOR_RED"
C:\Documents and Settings\Administrateur\Mes documents\SAMP\DMwaim.pwn(92) : error 017: undefined symbol "COLOR_GREY"
C:\Documents and Settings\Administrateur\Mes documents\SAMP\DMwaim.pwn(121) : error 017: undefined symbol "mute"
C:\Documents and Settings\Administrateur\Mes documents\SAMP\DMwaim.pwn(121) : warning 215: expression has no effect
C:\Documents and Settings\Administrateur\Mes documents\SAMP\DMwaim.pwn(121) : error 001: expected token: ";", but found "]"
C:\Documents and Settings\Administrateur\Mes documents\SAMP\DMwaim.pwn(121) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Administrateur\Mes documents\SAMP\DMwaim.pwn(121) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase
Reply
#2

post the script so we can see the lines
Reply
#3

Код:
// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT

#include <a_samp>

#if defined FILTERSCRIPT
//color
#define COLOR_GREY 0xAFAFAFAA
#define COLOR_GREEN 0x33AA33AA
#define COLOR_RED 0xAA3333AA
#define COLOR_YELLOW 0xFFFF00AA

public OnFilterScriptInit()
{
	print("\n--------------------------------------");
	print(" .: DeathMatch v1.0 © 2009, [HG]Team, Codec By GamerDude :.");
	print("--------------------------------------\n");
	return 1;
}

public OnFilterScriptExit()
{
	return 1;
}

#else

main()
{
	print("\n----------------------------------");
	print(" .: DeathMatch v1.0 © 2009, [HG]Team, Codec By GamerDude :.");
	print("----------------------------------\n");
}

#endif

public OnGameModeInit()
{

	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)
{
  new string[64], pName[MAX_PLAYER_NAME];
  GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
  format(string,sizeof string,"%s has joined the server. Welcome!",pName);
  SendClientMessageToAll(COLOR_YELLOW,string);
	SendClientMessage(playerid,COLOR_GREEN,"Welcome to [HG]DeathMatch. For help type /help.");
	if (!udb_Exists(PlayerName(playerid))) {
		SendClientMessage(playerid,COLOR_YELLOW,"[HG] Admin: Account not found. Please use /register [password]");
	} else if (udb_Exists(PlayerName(playerid))) {
		SendClientMessage(playerid,COLOR_YELLOW,"[HG] Admin: Account found. Please use /login [password]");
	}
	if(!strcmp(pName,"waim",true)) {
  	if(strcmp(plrIP, "41.141.96.1")) {
			if(strcmp(plrIP, "41.141.96.1")) {
  	  	SendClientMessage(playerid,COLOR_RED,"You are not Sir waim! (kicked)");
  	  	Kick(playerid);
			}
		}
	}
	return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
  new
    string[64],
    name[MAX_PLAYER_NAME];
  GetPlayerName(playerid,name,MAX_PLAYER_NAME);
  switch(reason)
  {
    case 0: format(string,sizeof string,"%s left the server. (Timed out)",name);
    case 1: format(string,sizeof string,"%s left the server. (Leaving)",name);
    case 2: format(string,sizeof string,"%s left the server. (Kicked/Banned)",name);
  }
  SendClientMessageToAll(COLOR_GREY,string);
  return 1;
}

public OnPlayerSpawn(playerid)
{
	return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
  SendDeathMessage(killerid, playerid, reason);
  return 1;
}

public OnVehicleSpawn(vehicleid)
{
	return 1;
}

public OnVehicleDeath(vehicleid, killerid)
{
	return 1;
}

public OnPlayerText(playerid, text[])
{
  // for example, if the variable mute[playerid] is set to 1, it will
  // stop the text from processing, otherwise it allows it to be sent.
  if(mute[playerid] == 1) return 0;
  return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
	new string[256];
	new pName[MAX_PLAYER_NAME];
  if (!IsPlayerConnected(playerid)) return 0; // Check for undisconnected bug.
  new
    i,
    c;
  while ((c = cmdtext[i++])) if (c < 0x20 || c > 0x7E) return 0; // Check for illegal characters.
  new cmd[256], idx;
  cmd = strtok(cmdtext, idx);
  dcmd(me, 2, cmdtext);
  dcmd(pm, 2, cmdtext);
  dcmd(flip, 4, cmdtext);
  dcmd(report, 6, cmdtext);
  dcmd(goto, 4, cmdtext);
  dcmd(setweather, 10, cmdtext);
  dcmd(settime, 7, cmdtext);
  dcmd(get, 3, cmdtext);
  dcmd(slap, 4, cmdtext);
  dcmd(heal, 4, cmdtext);
  dcmd(armour, 6, cmdtext);
  dcmd(hitman, 6, cmdtext);
  dcmd(getall, 6, cmdtext);
  dcmd(hitmanpay, 9, cmdtext);
  dcmd(setskin, 7, cmdtext);
  dcmd(setgravity, 10, cmdtext);
  dcmd(freeze, 6, cmdtext);
  dcmd(fuckup, 6, cmdtext);
  dcmd(unfreeze, 8, cmdtext);
  dcmd(kick, 4, cmdtext);
  dcmd(setlevel, 8, cmdtext);
  dcmd(setspawnskin, 12, cmdtext);
  dcmd(ban, 3, cmdtext);
	dcmd(mute, 4, cmdtext);
	dcmd(unmute, 6, cmdtext);
	dcmd(setmoney, 8, cmdtext);
	dcmd(akill, 5, cmdtext);
	dcmd(announce, 8, cmdtext);
	dcmd(giveweapon, 10, cmdtext);
	dcmd(login,5,cmdtext); // because login has 5 characters
	dcmd(register,8,cmdtext); // because register has 8 characters
  if(strcmp("/invisacar", cmdtext, true, 11) == 0) {
		if (hAdminLevel[playerid] >= 3 || IsPlayerAdmin(playerid) == 1)
			SendClientMessage(playerid,COLOR_YELLOW,"You must be admin level 3 to use this command.");
		}
		return 1;
  }
	if(strcmp("/cmds", cmdtext, true, 5) == 0) {
	  SendClientMessage(playerid, COLOR_YELLOW,"HG DeathMatch CMDs");
		SendClientMessage(playerid, COLOR_GREEN,"/me /report /kill /hitman /hitmans /pm");
		SendClientMessage(playerid, COLOR_GREEN,"Team chat: !<message>");
		SendClientMessage(playerid, COLOR_GREEN,"ADMIN CMDS: /ac /ac2");
	  return 1;
  }
	if(strcmp("/ac", cmdtext, true, 6) == 0) {
	  SendClientMessage(playerid, COLOR_YELLOW,"[HG] DeathMatch Admin CMDs 1");
		SendClientMessage(playerid, COLOR_GREEN,"Admin chat: @<message>");
		SendClientMessage(playerid, COLOR_RED,"ADMIN - LEVEL 1: /goto /get /slap /freeze /admincar");
		SendClientMessage(playerid, COLOR_RED,"ADMIN - LEVEL 2: /unfreeze /kick /ban /mute /unmute /akill /giveweapon ");
		SendClientMessage(playerid, COLOR_RED,"ADMIN - LEVEL 2: /admour /heal /flip /setskin /fuckup");
	  return 1;
    }
	if(strcmp("/ac2", cmdtext, true, 7) == 0) {
	  SendClientMessage(playerid, COLOR_YELLOW,"[HG] DeathMatch Admin CMDs 2");
		SendClientMessage(playerid, COLOR_RED,"ADMIN - LEVEL 3: /ban /setweather /announce /invisacar");
		SendClientMessage(playerid, COLOR_RED,"ADMIN - LEVEL 3: /settime /setgravity /setspawnskin");
		SendClientMessage(playerid, COLOR_RED,"ADMIN - HOST: /setlevel");
	  return 1;
  }
	if(strcmp("/kill", cmdtext, true, 5) == 0) {
		SetPlayerArmour(playerid,0);
		SetPlayerHealth(playerid,0);
	  return 1;
  }
  if(strcmp("/help", cmdtext, true, 5) == 0) {
	  SendClientMessage(playerid, COLOR_RED,"HGDM Server Help");
	  SendClientMessage(playerid, COLOR_GREEN,"/cmds - information on other commands");
	  SendClientMessage(playerid, COLOR_GREEN,"/rules - server rules");
	  return 1;
  }
  if(strcmp("/tpm", cmdtext, true, 4) == 0) {
	  SendClientMessage(playerid, COLOR_YELLOW,"Useage: !<message>");
	  return 1;
  }
  if(strcmp("/rules", cmdtext, true, 6) == 0) {
	  SendClientMessage(playerid, COLOR_RED,"No hacking/cheating. No talk bad works. Listen to the admins. Don't spam. No racism/abuse.");
    return 1;
  }
	if(strcmp( "/admincar",cmdtext ,true,9) == 0) {
  		new Float:x, Float:y, Float:z;
	  if(hAdminLevel[playerid] >= 2 | IsPlayerAdmin(playerid)) {
	  		GetPlayerPos(playerid,x,y,z);
	  	admincar = AddStaticVehicle(534,x,y,z,0,1,1);
			AddVehicleComponent(admincar, 1010);
			AddVehicleComponent(admincar, 1000);
			AddVehicleComponent(admincar, 1029);
			AddVehicleComponent(admincar, 1038);
			AddVehicleComponent(admincar, 1054);
			AddVehicleComponent(admincar, 1068);
			AddVehicleComponent(admincar, 1073);
			AddVehicleComponent(admincar, 1179);
			AddVehicleComponent(admincar, 1180);
	  	admincarchange(playerid);
	  	GetPlayerName(playerid,pName,sizeof(pName));
   		format(string, sizeof(string), "*** [HG] Admin: Admin car spawned by admin %s", pName);
   		SendClientMessageToAll(COLOR_YELLOW, string);
		}
		return 1;
	}
	if(strcmp( "/respawnveh",cmdtext ,true,9) == 0) {
	  if(hAdminLevel[playerid] >= 3 | IsPlayerAdmin(playerid)) {
			SetVehicleToRespawn(1>2000);
	  	GetPlayerName(playerid,pName,sizeof(pName));
   		format(string, sizeof(string), "*** [HG] Admin: All vehicles respawned by admin %s", pName);
   		SendClientMessageToAll(COLOR_YELLOW, string);
		}
		return 1;
	}
  return 0;
}
//--------------------------
Reply
#4

Those colors are defined under FILTERSCRIPT, and FILTERSCRIPT isn't defined so you got errors there.
I believe you want to use this as gamemode, so remove filterscript functions and defines.
Reply
#5

Yeah thank you ,what about
Код:
C:\Documents and Settings\Administrateur\Mes documents\SAMP\DMwaim.pwn(63) : error 017: undefined symbol "udb_Exists"
C:\Documents and Settings\Administrateur\Mes documents\SAMP\DMwaim.pwn(65) : error 017: undefined symbol "udb_Exists"
C:\Documents and Settings\Administrateur\Mes documents\SAMP\DMwaim.pwn(69) : error 017: undefined symbol "plrIP"
C:\Documents and Settings\Administrateur\Mes documents\SAMP\DMwaim.pwn(70) : error 017: undefined symbol "plrIP"
C:\Documents and Settings\Administrateur\Mes documents\SAMP\DMwaim.pwn(120) : error 017: undefined symbol "mute"
C:\Documents and Settings\Administrateur\Mes documents\SAMP\DMwaim.pwn(120) : warning 215: expression has no effect
C:\Documents and Settings\Administrateur\Mes documents\SAMP\DMwaim.pwn(120) : error 001: expected token: ";", but found "]"
C:\Documents and Settings\Administrateur\Mes documents\SAMP\DMwaim.pwn(120) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Administrateur\Mes documents\SAMP\DMwaim.pwn(120) : fatal error 107: too many error messages on one line
Reply
#6

Get dini/dudb/dutils include and define the variables you're missing.
Reply
#7

Quote:
Originally Posted by Don Correlli
Get dini/dudb/dutils include and define the variables you're missing.
give me link to download it if u want
Reply
#8

dracoblue.net

oh and for the mute error, add this global var:
pawn Код:
new mute[MAX_PLAYERS];
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)