What is wrong with this script?
#1

Does anyone knows what's wrong with this script?:
Код:
#include <a_samp>

#if defined FILTERSCRIPT

main()
{
	print("\n----------------------------------");
	print(" Super DM 0.1 Closed Beta");
	print("----------------------------------\n");
}

//colors
#define COLOR_GREY 0xAFAFAFAA
#define COLOR_GREEN 0x33AA33AA
#define COLOR_BRIGHTRED 0xFF0000AA
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_PINK 0xFF66FFAA
#define COLOR_BLUE 0x3A47DEFF
#define COLOR_TAN 0xBDB76BAA
#define COLOR_PURPLE 0x800080AA
#define COLOR_WHITE 0xFFFFFFAA
#define COLOR_LIGHTBLUE 0x33CCFFAA
#define COLOR_ORANGE 0xFF9900AA
#define COLOR_INDIGO 0x4B00B0AA
#define COLOR_BLACK 0x00000000
#define COLOR_DARKGREY 0x696969FF

//teams
#define TEAM_ARMY 1
#define TEAM_AZTECAS 2
#define TEAM_ARMY_COLOR 0x00FF00AA // Bright Green (in RGBA format)
#define TEAM_AZTECAS_COLOR 0xFF00FFAA // Bright Purple

new gTeam[MAX_PLAYERS];

#endif

public OnGameModeInit()
{
	//misc
	SetGameModeText("Super DM 0.1 CBT");
	//classes
  AddPlayerClass(287,1787.2034,-1208.1097,16.9346,356.4398,0,0,0,0,31,10000); // guyspawn
  AddPlayerClass(115,2117.5496,-1166.9548,24.3676,69.7454,0,0,0,0,30,10000); // guyspawn2
  //vehicles
	//interior
	CreateObject(987, 1780.834229, -1263.665649, 12.548006, 0.0000, 0.0000, 273.1970);
  CreateObject(987, 1781.192505, -1275.500122, 12.468750, 0.0000, 0.0000, 290.3857);
  CreateObject(987, 1785.298584, -1286.605225, 12.632813, 0.0000, 0.0000, 272.3375);
  CreateObject(987, 1781.466431, -1191.578125, 22.893497, 0.0000, 0.0000, 92.8191);
  CreateObject(987, 1780.533691, -1179.895874, 22.828125, 0.0000, 0.0000, 83.3653);
	CreateObject(987, 1781.601685, -1168.075317, 22.657578, 0.0000, 0.0000, 61.8794);
  CreateObject(987, 1784.521362, -1161.519775, 27.844975, 0.0000, 0.0000, 345.3896);
  CreateObject(987, 1796.058105, -1164.560547, 27.844975, 0.0000, 0.0000, 349.6868);
  CreateObject(987, 1851.088501, -1069.812378, 24.101257, 0.0000, 0.0000, 89.3814);
  CreateObject(987, 1850.166748, -1057.755249, 23.296064, 0.0000, 0.0000, 81.6464);
  CreateObject(987, 1851.583984, -1046.062134, 23.120827, 0.0000, 0.0000, 84.2247);
  CreateObject(987, 1852.353149, -1034.931152, 23.070082, 0.0000, 0.0000, 39.5341);
  CreateObject(987, 1976.992065, -1035.843994, 23.784456, 0.0000, 0.0000, 351.4056);
  CreateObject(987, 1988.206299, -1037.126709, 23.476357, 0.0000, 0.0000, 344.5301);
  CreateObject(987, 1999.022217, -1040.294312, 23.655579, 0.0000, 0.0000, 341.9518);
  CreateObject(987, 2010.126587, -1043.702026, 23.701418, 0.0000, 0.0000, 0.0000);
  CreateObject(987, 2019.864990, -1038.887207, 24.562572, 0.0000, 0.0000, 355.7028);
  CreateObject(987, 2020.312256, -1033.604126, 23.760336, 0.0000, 0.0000, 267.1809);
  CreateObject(987, 2030.055542, -1039.400269, 24.305452, 0.0000, 0.0000, 346.2490);
  CreateObject(987, 2039.508423, -1042.537354, 24.788322, 0.0000, 0.0000, 351.4056);
  CreateObject(987, 2052.698730, -1280.235474, 23.792017, 0.0000, 0.0000, 0.0000);
  CreateObject(987, 2063.865723, -1280.979736, 22.820313, 0.0000, 0.0000, 0.0000);
  CreateObject(987, 2075.742432, -1281.236328, 22.828106, 0.0000, 0.0000, 0.0000);
  CreateObject(987, 2089.878906, -1269.037598, 24.589237, 0.0000, 0.0000, 91.9597);
  CreateObject(987, 2087.463623, -1264.110718, 23.852180, 0.0000, 0.0000, 66.1766);
  CreateObject(987, 2092.104248, -1253.507080, 24.492020, 0.0000, 0.0000, 94.5380);
  CreateObject(987, 2089.966553, -1211.230225, 22.979820, 0.0000, 0.0000, 268.8998);
  CreateObject(987, 2089.199707, -1222.947876, 22.812500, 0.0000, 0.0000, 274.9158);
  CreateObject(987, 2089.380371, -1234.253906, 24.477465, 0.0000, 0.0000, 280.9319);
  CreateObject(987, 2113.562256, -1162.949707, 24.853981, 0.0000, 0.0000, 0.0000);
  CreateObject(987, 2125.090088, -1162.760376, 27.156204, 0.0000, 0.0000, 268.8998);
  CreateObject(987, 2124.594238, -1174.690308, 27.803646, 0.0000, 0.0000, 272.3375);
  CreateObject(987, 2124.721436, -1186.721802, 27.854927, 0.0000, 0.0000, 272.3375);
  CreateObject(987, 2113.463379, -1197.504639, 27.161232, 0.0000, 0.0000, 0.0000);
  CreateObject(987, 2102.821777, -1197.184570, 27.386745, 0.0000, 0.0000, 0.0000);
  CreateObject(987, 2091.857666, -1196.712280, 27.860020, 0.0000, 0.0000, 0.0000);
  CreateObject(987, 2089.328369, -1211.338623, 27.135881, 0.0000, 0.0000, 90.2408);
  CreateObject(987, 2088.421387, -1200.318481, 27.185080, 0.0000, 0.0000, 18.0482);
  CreateObject(987, 2090.305908, -1269.460693, 28.736843, 0.0000, 0.0000, 265.4620);
  CreateObject(987, 2087.073242, -1281.455200, 24.497177, 0.0000, 0.0000, 58.4416);
  CreateObject(987, 2091.349365, -1245.104858, 28.245853, 0.0000, 0.0000, 96.2569);
  CreateObject(987, 2113.153809, -1162.524292, 24.846889, 0.0000, 0.0000, 89.3814);
  CreateObject(987, 2113.400146, -1150.970947, 24.829262, 0.0000, 0.0000, 85.0842);
  CreateObject(987, 2114.846680, -1138.865112, 24.992538, 0.0000, 1.7189, 86.8030);
  CreateObject(987, 2115.275391, -1127.286743, 25.373596, 0.0000, 0.0000, 84.2247);
  CreateObject(987, 2116.833252, -1118.281494, 24.302675, 0.0000, 0.0000, 90.2408);
  CreateObject(987, 2116.893799, -1106.356323, 24.116226, 0.0000, 0.0000, 113.4455);
  CreateObject(987, 2112.477295, -1095.286865, 23.873363, 0.0000, 0.0000, 131.4938);
  CreateObject(987, 2086.202393, -1084.596802, 24.150225, 0.0000, 0.0000, 0.0000);
  CreateObject(987, 2068.114014, -1075.610596, 24.273590, 0.0000, 0.0000, 0.0000);
  CreateObject(987, 1831.351563, -1278.630737, 12.596268, 0.0000, 0.0000, 0.0000);
  CreateObject(987, 1841.953735, -1278.972900, 12.389833, 0.0000, 0.0000, 0.0000);
  CreateObject(987, 1852.657471, -1278.995850, 12.389921, 0.0000, 0.0000, 0.0000);
  CreateObject(987, 2044.767822, -1270.895264, 23.891628, 0.0000, 0.0000, 0.0000);
  CreateObject(987, 2033.596313, -1270.967285, 24.188002, 0.0000, 0.0000, 0.0000);
  CreateObject(987, 2023.156982, -1270.898193, 24.188034, 0.0000, 0.0000, 0.0000);
  CreateObject(987, 2011.530518, -1291.304443, 22.936546, 0.0000, 0.0000, 0.0000);
  CreateObject(987, 2023.064331, -1270.960815, 24.295506, 0.0000, 0.0000, 271.4781);
  CreateObject(987, 2023.381104, -1282.946533, 23.994381, 0.0000, 0.0000, 268.0403);
  CreateObject(987, 2056.801514, -1271.152222, 22.984375, 0.0000, 0.0000, 262.0243);
  CreateObject(987, 1781.533569, -1251.344360, 12.685635, 0.0000, 0.0000, 0.0000);
  CreateObject(987, 1790.102417, -1252.682251, 12.861748, 0.0000, 0.0000, 269.7592);
  CreateObject(987, 1789.654297, -1264.561401, 12.632813, 0.0000, 0.0000, 280.9319);
  CreateObject(987, 1791.746338, -1276.323608, 12.468750, 0.0000, 0.0000, 295.5423);
  CreateObject(987, 1796.696289, -1287.181885, 12.570267, 0.0000, 0.0000, 284.3696);
  CreateObject(987, 1800.385498, -1252.684814, 12.721972, 0.0000, 0.0000, 281.7913);
  CreateObject(987, 1802.622559, -1264.305664, 12.468750, 0.0000, 0.0000, 288.6668);
  CreateObject(987, 1806.413940, -1275.616699, 12.632813, 0.0000, 0.0000, 296.4017);
  CreateObject(987, 1811.449951, -1286.217896, 12.607701, 0.0000, 0.0000, 331.6386);
  CreateObject(987, 1832.694946, -1250.345825, 12.685415, 0.0000, 0.0000, 265.4620);
  CreateObject(987, 1832.050171, -1262.198975, 12.468750, 0.0000, 0.0000, 257.7271);
  CreateObject(987, 1829.176758, -1272.965210, 12.611919, 0.0000, 0.0000, 279.2130);
  CreateObject(987, 1782.852539, -1192.538696, 22.906250, 0.0000, 0.0000, 0.0000);
  CreateObject(987, 1791.878906, -1190.777466, 23.019360, 0.0000, 0.0000, 89.3814);
  CreateObject(987, 1791.919800, -1179.063843, 22.650494, 0.0000, 0.0000, 73.9115);
  CreateObject(987, 1795.104492, -1167.778198, 22.828125, 0.0000, 0.0000, 72.1926);
  CreateObject(987, 1801.317749, -1190.963013, 24.414528, 0.0000, 0.0000, 82.5059);
  CreateObject(987, 1801.838623, -1179.139771, 22.642750, 0.0000, 0.0000, 73.0521);
  CreateObject(987, 1805.332153, -1168.187988, 22.828125, 0.0000, 0.0000, 30.0803);
  CreateObject(987, 1833.004395, -1191.209229, 22.994701, 0.0000, 0.0000, 96.2569);
  CreateObject(987, 1831.511353, -1179.741333, 22.633099, 0.0000, 0.0000, 92.8191);
  CreateObject(987, 2114.626953, -1192.392944, 22.977280, 0.0000, 0.0000, 0.0000);
  CreateObject(987, 2111.933838, -1192.341919, 24.047571, 0.0000, 0.0000, 0.0000);
  CreateObject(987, 2112.560303, -1161.662109, 24.840824, 0.0000, 1.7189, 262.8837);
  CreateObject(987, 2110.965088, -1173.110840, 24.535322, 0.0000, 1.7189, 274.0564);
	CreateObject(987, 2105.471191, -1192.238037, 22.714596, 0.0000, 0.0000, 261.1648);
  CreateObject(987, 2111.455078, -1184.947754, 24.125223, 0.0000, 0.0000, 271.4781);
  CreateObject(987, 2111.194824, -1192.585571, 22.642815, 0.0000, 0.0000, 268.8998);
  CreateObject(987, 2082.748047, -1199.924194, 23.288784, 0.0000, 0.0000, 90.2408);
  CreateObject(8229, 2092.668213, -1176.864380, 27.294979, 0.0000, 0.8594, 85.0842);
  CreateObject(8229, 2097.250244, -1194.864868, 25.556808, 0.0000, 0.0000, 267.1809);
  CreateObject(8229, 2096.350830, -1154.995972, 27.294979, 0.0000, 0.0000, 268.8998);
  CreateObject(8229, 2099.958496, -1133.705688, 27.469025, 0.0000, 0.0000, 286.9479);
  CreateObject(8229, 2109.865967, -1119.268066, 28.400467, 0.0000, 0.0000, 0.0000);
	return 1;
}

public OnGameModeExit()
{
	return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
	SetPlayerPos(playerid, 1739.2070,-1655.9050,34.4546);
	SetPlayerFacingAngle(playerid, 270.9183)
	SetPlayerCameraPos(playerid, 1743.6565,-1655.5934,34.4568);
	SetPlayerCameraLookAt(playerid, 1739.2070,-1655.9050,34.4546);
	SetPlayerTeamFromClass(playerid, classid);
	return 1;
}

public SetPlayerTeamFromClass(playerid, classid)
{
	if (classid == 0)
	{
		gTeam[playerid] = TEAM_ARMY;
	}
	else
	{
		gTeam[playerid] = TEAM_AZTECAS;
	}
}

SetPlayerToTeamColor(playerid)
{
	if (gTeam[playerid] == TEAM_ARMY)
	{
		SetPlayerColor(playerid, TEAM_ARMY_COLOR);
	}
	else if (gTeam[playerid] == TEAM_AZTECAS)
	{
		SetPlayerColor(playerid, TEAM_AZTECAS_COLOR);
	}
}


public OnPlayerConnect(playerid)
{
	return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
	return 1;
}

public OnPlayerSpawn(playerid)
{
	SetPlayerToTeamColor(playerid);
	return 1;
}

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

public OnVehicleSpawn(vehicleid)
{
	return 1;
}

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

public OnPlayerText(playerid, text[])
{
	return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext,"/deployarmy",true)==0)
{
new vehicleid = GetPlayerVehicleID(playerid);
new State = GetPlayerState(playerid);
if(IsPlayerInAnyVehicle(playerid) && State == PLAYER_STATE_DRIVER)
{
GameTextForPlayer(playerid,"you have been deployed to the battlefield!",4000,6);
return SetVehiclePos(vehicleid,1848.4347,-1260.7603,13.3906);
}
SetPlayerPos(playerid,1848.4347,-1260.7603,13.3906);
GameTextForPlayer(playerid,"you have been deployed to the battlefield!",4000,6);
return 1;
}

if(strcmp(cmdtext,"/deployterror",true)==0)
{
new vehicleid = GetPlayerVehicleID(playerid);
new State = GetPlayerState(playerid);
if(IsPlayerInAnyVehicle(playerid) && State == PLAYER_STATE_DRIVER)
{
GameTextForPlayer(playerid,"you have been deployed to the battlefield!",4000,6);
return SetVehiclePos(vehicleid,2080.3455,-1094.0223,24.8687);
}
SetPlayerPos(playerid,2080.3455,-1094.0223,24.8687);
GameTextForPlayer(playerid,"you have deployed to the battlefield!",4000,6);
return 1;
}
	return 1;
}

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{

	return 1;
}

public OnPlayerExitVehicle(playerid, vehicleid)
{
	return 1;
}

public OnPlayerStateChange(playerid, newstate, oldstate)
{
	return 1;
}

public OnPlayerEnterCheckpoint(playerid)
{
	return 1;
}

public OnPlayerLeaveCheckpoint(playerid)
{
	return 1;
}

public OnPlayerEnterRaceCheckpoint(playerid)
{
	return 1;
}

public OnPlayerLeaveRaceCheckpoint(playerid)
{
	return 1;
}

public OnRconCommand(cmd[])
{
	return 1;
}

public OnPlayerRequestSpawn(playerid)
{
	return 1;
}

public OnObjectMoved(objectid)
{
	return 1;
}

public OnPlayerObjectMoved(playerid, objectid)
{
	return 1;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
	return 1;
}

public OnVehicleMod(playerid, vehicleid, componentid)
{
	return 1;
}

public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
{
	return 1;
}

public OnVehicleRespray(playerid, vehicleid, color1, color2)
{
	return 1;
}

public OnPlayerSelectedMenuRow(playerid, row)
{
	return 1;
}

public OnPlayerExitedMenu(playerid)
{
	return 1;
}

public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
	return 1;
}

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
	return 1;
}

public OnRconLoginAttempt(ip[], password[], success)
{
	return 1;
}

public OnPlayerUpdate(playerid)
{
	return 1;
}

public OnPlayerStreamIn(playerid, forplayerid)
{
	return 1;
}

public OnPlayerStreamOut(playerid, forplayerid)
{
	return 1;
}

public OnVehicleStreamIn(vehicleid, forplayerid)
{
	return 1;
}

public OnVehicleStreamOut(vehicleid, forplayerid)
{
	return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
	return 1;
}

public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
	return 1;
}
i get this errors:
Код:
C:\Users\Max\Desktop\SeifAdmin[1]\dutchtdm.pwn(159) : warning 235: public function lacks forward declaration (symbol "SetPlayerTeamFromClass")
C:\Users\Max\Desktop\SeifAdmin[1]\dutchtdm.pwn(163) : error 017: undefined symbol "gTeam"
C:\Users\Max\Desktop\SeifAdmin[1]\dutchtdm.pwn(163) : warning 215: expression has no effect
C:\Users\Max\Desktop\SeifAdmin[1]\dutchtdm.pwn(163) : error 001: expected token: ";", but found "]"
C:\Users\Max\Desktop\SeifAdmin[1]\dutchtdm.pwn(163) : error 029: invalid expression, assumed zero
C:\Users\Max\Desktop\SeifAdmin[1]\dutchtdm.pwn(163) : fatal error 107: too many error messages on one line

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


4 Errors.
>Exit code: 1  Time: 0.359
Reply
#2

Errrrr show errors from compiling?
Reply
#3

yea
Reply
#4

Oh didnt see that ok,i never got stuck with these problems,sorry. =/
Reply
#5

ok
Reply
#6

remove: #if defined FILTERSCRIPT

and: #endif

Your new gTeam[MAX_PLAYERS]; is inside those tags, so the script didnt see it

Also, there is another error, missing a ';'



Quote:

SetPlayerPos(playerid, 1739.2070,-1655.9050,34.4546);
SetPlayerFacingAngle(playerid, 270.9183); <--
SetPlayerCameraPos(playerid, 1743.6565,-1655.5934,34.456;
SetPlayerCameraLookAt(playerid, 1739.2070,-1655.9050,34.4546);

Reply
#7

ok, now it compiles and works, but how to make it that you cant hit any teammate? and classbound teleport?
Reply
#8

For anti-teamkill use SetPlayerTeam.
Reply
#9

and classbound teleport?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)