Some errors in "Anti Team Kill"
#1

While scripting I've found some errors / Warnings pumped into my script, I would like to see if anyone can help me.

Код:
public OnPlayerSpawn(playerid)
{
    if(dm1[playerid] == 1)
	{
		new rand = random(sizeof(dm1RandomSpawns));
		SetPlayerPos(playerid, dm1RandomSpawns[rand][0], dm1RandomSpawns[rand][1], dm1RandomSpawns[rand][2]);
        ResetPlayerWeapons(playerid);
  		SetPlayerVirtualWorld(playerid, 1);
		SetPlayerHealth(playerid, 100);
		SetPlayerArmour(playerid, 100);
		GivePlayerWeapon(playerid, 22, 99999);
		GivePlayerWeapon(playerid, 26, 99999);
		GivePlayerWeapon(playerid, 28, 99999);
		dm1[playerid] = 1;
		return 1;
	}
	else if(dm2[playerid] == 1)
	{
		ResetPlayerWeapons(playerid); //nothing after to playerid becuz nothing to change, no ammo, coordinates, amount of anything :D
		SetPlayerVirtualWorld(playerid, 1);
		SetPlayerHealth(playerid, 100);
		SetPlayerArmour(playerid, 100);
		GivePlayerWeapon(playerid, 24, 99999);
		GivePlayerWeapon(playerid, 27, 99999);
		GivePlayerWeapon(playerid, 29, 99999);
		GivePlayerWeapon(playerid, 31, 99999);
		GivePlayerWeapon(playerid, 34, 99999);
		new rand = random(sizeof(dm2RandomSpawns));
		SetPlayerPos(playerid, dm2RandomSpawns[rand][0], dm2RandomSpawns[rand][1], dm2RandomSpawns[rand][2]);
		dm2[playerid] = 1;
		return 1;
	}
	else if(dm4[playerid] == 1)
	{
		ResetPlayerWeapons(playerid); //nothing after to playerid becuz nothing to change, no ammo, coordinates, amount of anything :D
		SetPlayerVirtualWorld(playerid, 1);
		SetPlayerHealth(playerid, 100);
		SetPlayerArmour(playerid, 100);
		GivePlayerWeapon(playerid, 35, 99999);
		GivePlayerWeapon(playerid, 16, 99999);
		new rand = random(sizeof(dm4RandomSpawns));
		SetPlayerPos(playerid, dm4RandomSpawns[rand][0], dm4RandomSpawns[rand][1], dm4RandomSpawns[rand][2]);
		dm4[playerid] = 1;
		return 1;
	}
	else if(dm5[playerid] == 1)
	{
	    dm5[playerid] = 1;
		new rand = random(sizeof(dm5RandomSpawns));
		SetPlayerPos(playerid, dm5RandomSpawns[rand][0], dm5RandomSpawns[rand][1], dm5RandomSpawns[rand][2]);
	    ResetPlayerWeapons(playerid);
		SetPlayerVirtualWorld(playerid, 1);
		SetPlayerHealth(playerid, 100);
		SetPlayerArmour(playerid, 100);
		GivePlayerWeapon(playerid, 34, 99999);
		SetPlayerInterior(playerid, 0);
		SetPlayerVirtualWorld(playerid, 0);
		dm5[playerid] = 1;
		return 1;
	}
	else if(dm6[playerid] == 1)
	{
		new rand = random(sizeof(dm6RandomSpawns));
		SetPlayerPos(playerid, dm6RandomSpawns[rand][0], dm6RandomSpawns[rand][1], dm6RandomSpawns[rand][2]);
    	ResetPlayerWeapons(playerid);
		SetPlayerVirtualWorld(playerid, 1);
		SetPlayerHealth(playerid, 100);
		SetPlayerArmour(playerid, 100);
		GivePlayerWeapon(playerid, 28, 99999);
		GivePlayerWeapon(playerid, 25, 99999);
		GivePlayerWeapon(playerid, 30, 99999);
		GivePlayerWeapon(playerid, 33, 99999);
		dm6[playerid] = 1;
		return 1;
	}
	else if(derby[playerid] == 1)
	{
	    derby[playerid] = 0;
	    SpawnPlayer(playerid);
		return 1;
	}
	{
	if(Team[playerid] == 1) SetPlayerTeam(playerid, 1); // line 1505
	if(Team[playerid] == 2) SetPlayerTeam(playerid, 2); // 1506
	if(Team[playerid] == 3) SetPlayerTeam(playerid, 3); // 1507
	if(Team[playerid] == 4) SetPlayerTeam(playerid, 4); // 1508
	if(Team[playerid] == 5) SetPlayerTeam(playerid, 5); // 1509
	if(Team[playerid] == 6) SetPlayerTeam(playerid, 6); // 1510
	if(Team[playerid] == 7) SetPlayerTeam(playerid, 7);// 1511
	if(Team[playerid] == 8) SetPlayerTeam(playerid, 8);// 1512
	return 1;
	}
Код:
public OnPlayerRequestClass(playerid, classid)
{
	//RULES
	TextDrawHideForPlayer(playerid, rules0);
    TextDrawHideForPlayer(playerid, rules1);
    TextDrawHideForPlayer(playerid, rules2);
    //-----------------------------------------
	SetPlayerTeamFromClass(playerid, classid);
    switch (classid)
	{
	    case 0,1,2,3://GROVE
		{
 			if(classid == 0 || classid == 1 || classid == 2 || classid == 3)
			{
			Team[playerid] = 1; // 1169
			GameTextForPlayer(playerid,"~g~GROVE",800,6);
			}
		    TextDrawHideForPlayer(playerid,aztec0);
			TextDrawHideForPlayer(playerid,aztec1);
			TextDrawHideForPlayer(playerid,cop0);
			TextDrawHideForPlayer(playerid,cop1);
			TextDrawHideForPlayer(playerid,balla0);
			TextDrawHideForPlayer(playerid,balla1);
			TextDrawHideForPlayer(playerid,vago0);
			TextDrawHideForPlayer(playerid,vago1);
			TextDrawHideForPlayer(playerid,skate0);
			TextDrawHideForPlayer(playerid,skate1);
			TextDrawHideForPlayer(playerid,bike0);
			TextDrawHideForPlayer(playerid,bike1);
			TextDrawHideForPlayer(playerid,red0);
			TextDrawHideForPlayer(playerid,red1);
		    TextDrawShowForPlayer(playerid, grove0);
			TextDrawShowForPlayer(playerid, grove1);
			SetPlayerPos(playerid, 2468.6868,-1660.0106,13.3356);
			SetPlayerCameraPos(playerid, 2462.4019,-1658.0359,13.3047);
			SetPlayerCameraLookAt(playerid, 2468.6868,-1660.0106,13.3356);
			SetPlayerFacingAngle(playerid, 70.7120);
		}
		case 4,5,6://AZTECA
		{
 			if(classid == 4 || classid == 5 || classid == 6)
			{
			Team[playerid] = 2; // 1198
			GameTextForPlayer(playerid,"~b~AZTECAS",800,6);
			}
			TextDrawHideForPlayer(playerid, grove0);
		 	TextDrawHideForPlayer(playerid, grove1);
		 	TextDrawShowForPlayer(playerid,aztec0);
			TextDrawShowForPlayer(playerid,aztec1);
			TextDrawHideForPlayer(playerid,cop0);
			TextDrawHideForPlayer(playerid,cop1);
			TextDrawHideForPlayer(playerid,balla0);
			TextDrawHideForPlayer(playerid,balla1);
			TextDrawHideForPlayer(playerid,vago0);
			TextDrawHideForPlayer(playerid,vago1);
			TextDrawHideForPlayer(playerid,skate0);
			TextDrawHideForPlayer(playerid,skate1);
			TextDrawHideForPlayer(playerid,bike0);
			TextDrawHideForPlayer(playerid,bike1);
			TextDrawHideForPlayer(playerid,red0);
			TextDrawHideForPlayer(playerid,red1);
		    SetPlayerPos(playerid, 1883.6093,-2018.6055,13.3906);
			SetPlayerCameraPos(playerid, 1883.2837,-2022.4531,13.3906);
			SetPlayerCameraLookAt(playerid, 1883.6093,-2018.6055,13.3906);
			SetPlayerFacingAngle(playerid, 180.6698);
		}
		case 7,8,9://POLICE
		{
 			if(classid == 7 || classid == 8 || classid == 9)
			{
			Team[playerid] = 3; // 1226
			GameTextForPlayer(playerid,"~b~Police",800,6);
			}
		    TextDrawHideForPlayer(playerid, grove0);
		 	TextDrawHideForPlayer(playerid, grove1);
		 	TextDrawHideForPlayer(playerid,aztec0);
			TextDrawHideForPlayer(playerid,aztec1);
			TextDrawShowForPlayer(playerid,cop0);
			TextDrawShowForPlayer(playerid,cop1);
			TextDrawHideForPlayer(playerid,balla0);
			TextDrawHideForPlayer(playerid,balla1);
			TextDrawHideForPlayer(playerid,vago0);
			TextDrawHideForPlayer(playerid,vago1);
			TextDrawHideForPlayer(playerid,skate0);
			TextDrawHideForPlayer(playerid,skate1);
			TextDrawHideForPlayer(playerid,bike0);
			TextDrawHideForPlayer(playerid,bike1);
			TextDrawHideForPlayer(playerid,red0);
			TextDrawHideForPlayer(playerid,red1);
		    SetPlayerPos(playerid, 1542.4088,-1675.7744,13.5544);
			SetPlayerCameraPos(playerid, 1537.7200,-1675.6154,13.5469);
			SetPlayerCameraLookAt(playerid, 1542.4088,-1675.7744,13.5544);
			SetPlayerFacingAngle(playerid, 90.1971);
		}
		case 10,11,12,13://BALLAS
		{
 			if(classid == 10 || classid == 11 || classid == 12 || classid == 13)
			{
			Team[playerid] = 4; // 1254
			GameTextForPlayer(playerid,"~p~BALLAS",800,6);
			}
		    TextDrawHideForPlayer(playerid, grove0);
		 	TextDrawHideForPlayer(playerid, grove1);
		 	TextDrawHideForPlayer(playerid,aztec0);
			TextDrawHideForPlayer(playerid,aztec1);
			TextDrawHideForPlayer(playerid,cop0);
			TextDrawHideForPlayer(playerid,cop1);
			TextDrawShowForPlayer(playerid,balla0);
			TextDrawShowForPlayer(playerid,balla1);
			TextDrawHideForPlayer(playerid,vago0);
			TextDrawHideForPlayer(playerid,vago1);
			TextDrawHideForPlayer(playerid,skate0);
			TextDrawHideForPlayer(playerid,skate1);
			TextDrawHideForPlayer(playerid,bike0);
			TextDrawHideForPlayer(playerid,bike1);
			TextDrawHideForPlayer(playerid,red0);
			TextDrawHideForPlayer(playerid,red1);
		    SetPlayerPos(playerid, 2012.8110,-1199.6431,20.0234);
			SetPlayerCameraPos(playerid, 2016.9944,-1199.9324,20.1287);
			SetPlayerCameraLookAt(playerid, 2012.8110,-1199.6431,20.0234);
			SetPlayerFacingAngle(playerid, 268.5099);
		}
		case 14,15,16://VAGOS
		{
			if(classid == 14 || classid == 15 || classid == 16)
			{
			Team[playerid] = 5; // 1282
			GameTextForPlayer(playerid,"~y~VAGOS",800,6);
			}
		    TextDrawHideForPlayer(playerid, grove0);
		 	TextDrawHideForPlayer(playerid, grove1);
		 	TextDrawHideForPlayer(playerid,aztec0);
			TextDrawHideForPlayer(playerid,aztec1);
			TextDrawHideForPlayer(playerid,cop0);
			TextDrawHideForPlayer(playerid,cop1);
			TextDrawHideForPlayer(playerid,balla0);
			TextDrawHideForPlayer(playerid,balla1);
			TextDrawShowForPlayer(playerid,vago0);
			TextDrawShowForPlayer(playerid,vago1);
			TextDrawHideForPlayer(playerid,skate0);
			TextDrawHideForPlayer(playerid,skate1);
			TextDrawHideForPlayer(playerid,bike0);
			TextDrawHideForPlayer(playerid,bike1);
			TextDrawHideForPlayer(playerid,red0);
			TextDrawHideForPlayer(playerid,red1);
		    SetPlayerPos(playerid, 2342.8362,-1163.9912,27.2021);
			SetPlayerCameraPos(playerid, 2341.7993,-1159.3503,27.1775);
			SetPlayerCameraLookAt(playerid, 2342.8362,-1163.9912,27.2021);
			SetPlayerFacingAngle(playerid, 356.8537);
		}
		case 17,18,19://BIKERS
		{
			if(classid == 17 || classid == 18 || classid == 19)
			{
			Team[playerid] = 6; // 1310
			GameTextForPlayer(playerid,"~w~BIKERS",800,6);
			}
		    TextDrawHideForPlayer(playerid, grove0);
		 	TextDrawHideForPlayer(playerid, grove1);
		 	TextDrawHideForPlayer(playerid,aztec0);
			TextDrawHideForPlayer(playerid,aztec1);
			TextDrawHideForPlayer(playerid,cop0);
			TextDrawHideForPlayer(playerid,cop1);
			TextDrawHideForPlayer(playerid,balla0);
			TextDrawHideForPlayer(playerid,balla1);
			TextDrawHideForPlayer(playerid,vago0);
			TextDrawHideForPlayer(playerid,vago1);
			TextDrawHideForPlayer(playerid,skate0);
			TextDrawHideForPlayer(playerid,skate1);
			TextDrawShowForPlayer(playerid,bike0);
			TextDrawShowForPlayer(playerid,bike1);
			TextDrawHideForPlayer(playerid,red0);
			TextDrawHideForPlayer(playerid,red1);
		    SetPlayerPos(playerid, 2358.3020,-1364.0977,24.0209);
			SetPlayerCameraPos(playerid, 2361.6592,-1363.7534,24.0028);
			SetPlayerCameraLookAt(playerid, 2358.3020,-1364.0977,24.0209);
            SetPlayerFacingAngle(playerid, 269.7348);
		}
		case 20,21://SKATERS
		{
		    if(classid == 20 || classid == 21)
		    {
		    Team[playerid] = 7; // 1338
		    GameTextForPlayer(playerid,"~w~SKATERS",800,6);
			}
		    TextDrawHideForPlayer(playerid, grove0);
		 	TextDrawHideForPlayer(playerid, grove1);
		 	TextDrawHideForPlayer(playerid,aztec0);
			TextDrawHideForPlayer(playerid,aztec1);
			TextDrawHideForPlayer(playerid,cop0);
			TextDrawHideForPlayer(playerid,cop1);
			TextDrawHideForPlayer(playerid,balla0);
			TextDrawHideForPlayer(playerid,balla1);
			TextDrawHideForPlayer(playerid,vago0);
			TextDrawHideForPlayer(playerid,vago1);
			TextDrawShowForPlayer(playerid,skate0);
			TextDrawShowForPlayer(playerid,skate1);
			TextDrawHideForPlayer(playerid,bike0);
			TextDrawHideForPlayer(playerid,bike1);
			TextDrawHideForPlayer(playerid,red0);
			TextDrawHideForPlayer(playerid,red1);
		    SetPlayerPos(playerid, 1958.6630,-1438.8093,13.8049);
			SetPlayerCameraPos(playerid, 1962.3132,-1440.2725,13.5665);
			SetPlayerCameraLookAt(playerid, 1958.6630,-1438.8093,13.8049);
			SetPlayerFacingAngle(playerid, 248.8850);
		}
		case 22,23,24,25://RED
		{
		    if(classid == 22 || classid == 23 || classid == 24 || classid == 25)
		    {
		    Team[playerid] = 8; // 1366
      		GameTextForPlayer(playerid,"~r~PIRUS",800,6);
			}
            TextDrawHideForPlayer(playerid, grove0);
		 	TextDrawHideForPlayer(playerid, grove1);
		 	TextDrawHideForPlayer(playerid,aztec0);
			TextDrawHideForPlayer(playerid,aztec1);
			TextDrawHideForPlayer(playerid,cop0);
			TextDrawHideForPlayer(playerid,cop1);
			TextDrawHideForPlayer(playerid,balla0);
			TextDrawHideForPlayer(playerid,balla1);
			TextDrawHideForPlayer(playerid,vago0);
			TextDrawHideForPlayer(playerid,vago1);
			TextDrawHideForPlayer(playerid,skate0);
			TextDrawHideForPlayer(playerid,skate1);
			TextDrawHideForPlayer(playerid,bike0);
			TextDrawHideForPlayer(playerid,bike1);
			TextDrawShowForPlayer(playerid,red0);
			TextDrawShowForPlayer(playerid,red1);
			SetPlayerPos(playerid, 821.5563,-1928.0509,12.8672);
			SetPlayerCameraPos(playerid, 826.1841,-1927.9393,12.8672);
			SetPlayerCameraLookAt(playerid, 821.5563,-1928.0509,12.8672);
			
		}
	}
	return 1;
}
D:\Scripts\ExtremeMissions\GW.pwn(1170 ) : warning 213: tag mismatch
D:\Scripts\ExtremeMissions\GW.pwn(1198 ) : warning 213: tag mismatch
D:\Scripts\ExtremeMissions\GW.pwn(1226 ) : warning 213: tag mismatch
D:\Scripts\ExtremeMissions\GW.pwn(1254 ) : warning 213: tag mismatch
D:\Scripts\ExtremeMissions\GW.pwn(1282 ) : warning 213: tag mismatch
D:\Scripts\ExtremeMissions\GW.pwn(1310 ) : warning 213: tag mismatch
D:\Scripts\ExtremeMissions\GW.pwn(1338 ) : warning 213: tag mismatch
D:\Scripts\ExtremeMissions\GW.pwn(1366 ) : warning 213: tag mismatch
D:\Scripts\ExtremeMissions\GW.pwn(1505 ) : warning 213: tag mismatch
D:\Scripts\ExtremeMissions\GW.pwn(1506 ) : warning 213: tag mismatch
D:\Scripts\ExtremeMissions\GW.pwn(1507 ) : warning 213: tag mismatch
D:\Scripts\ExtremeMissions\GW.pwn(1508 ) : warning 213: tag mismatch
D:\Scripts\ExtremeMissions\GW.pwn(1509 ) : warning 213: tag mismatch
D:\Scripts\ExtremeMissions\GW.pwn(1510 ) : warning 213: tag mismatch
D:\Scripts\ExtremeMissions\GW.pwn(1511 ) : warning 213: tag mismatch
D:\Scripts\ExtremeMissions\GW.pwn(1512 ) : warning 213: tag mismatch
Reply
#2

Warning lines ?
Reply
#3

@Berlovan, I already marked them. // (linehere) after everybugged lines
Reply
#4

hm, Can anybody help?
Reply
#5

Shouldn't it be "SetPlayerTeamFromClass" instead of SetPlayerTeam?
Reply
#6

No, it shouldnt be. whatever, It doesnt make sense with the Warnings.
Reply
#7

pawn Код:
enum Player{Team}

new PPPP[MAX_PLAYERS] [Player],

if(PPPP[playerid][Team] == 1) SetPlayerTeam(playerid, 1); // line 1505
if(PPPP[playerid][Team] == 2) SetPlayerTeam(playerid, 2); // 1506
if(PPPP[playerid][Team] == 3) SetPlayerTeam(playerid, 3); // 1507
I do that in this way.
Reply
#8

Those errors are basically telling you that you are using a function incorrectly.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)