again me! Look Here!!and help!
#1

solved
Reply
#2

Change
pawn Код:
SetTimer("zadm", 3000, 1);
to
pawn Код:
SetTimerEx("zadm", 3000, 1, "i", playerid);
Reply
#3

or try this:
Код:
//init
gate1 = CreateObject(971, 2916.6887, -791.7552, 13.6093, 0.0000, 0.0000, 270.0000);
gate2 = CreateObject(971, 2916.6934, -785.8185, 13.6021, 0.0000, 0.0000, 270.0000);
gate3 = CreateObject(971, 2919.5332, -826.4330, 14.3749, 0.0000, 0.0000, 270.0000);
SetTimer("zadm",3000,1);
//down
forward zadm();
public zadm()
{
	for(new playerid=0; playerid<MAX_PLAYERS; playerid++)
	{
		if(PlayerToPoint(15.0, playerid,2909.1292, -790.3306, 10.2547)&& OpenGate1[playerid] == false)
		{
			if(IsPlayerXAdmin(playerid)) return OpenGate1[playerid] = true,
			MoveObject(gate1, 2916.7163, -791.7419, 0.4390, 2.0),
			MoveObject(gate2, 2916.6914, -785.7935, 0.3271, 2.0),
			GameTextForPlayer(playerid, "Welcome", 5000, 3);
			if (!IsPlayerXAdmin(playerid)) return SendClientMessage(playerid, COLOR_RED,"You Must Be Admin!!!");
		}else if(!PlayerToPoint(15.0, playerid,2909.1292, -790.3306, 10.2547)&& OpenGate1[playerid] == true)
		{
			if(IsPlayerXAdmin(playerid))return OpenGate1[playerid] = false,
			MoveObject(gate1, 2916.6887, -791.7552, 13.6093, 2.0),
			MoveObject(gate2, 2916.6934, -785.8185, 13.6021, 2.0);
			if(!IsPlayerXAdmin(playerid))return SendClientMessage(playerid, COLOR_RED,"You Must Be Admin!!!");
		}
		//poarta2
		if(PlayerToPoint(15.0, playerid,2938.6484,-826.6721,11.7429)&& OpenGate2[playerid] == false)
		{
			if(IsPlayerXAdmin(playerid)) return OpenGate2[playerid] = true,
			MoveObject(gate3, 2919.5359, -826.4325, 6.5434, 2.0),
			GameTextForPlayer(playerid, "Bye!", 5000, 3);
			if(IsPlayerCommandLevel(playerid,"0"))return SendClientMessage(playerid, COLOR_RED,"You Must Be Admin!!!");
		}else if(!PlayerToPoint(15.0, playerid,2938.6484,-826.6721,11.7429)&& OpenGate2[playerid] == true)
		{
			if(IsPlayerXAdmin(playerid))return OpenGate2[playerid] = false,
			MoveObject(gate3, 2919.5332, -826.4330, 14.3749, 2.0);
			if(!IsPlayerXAdmin(playerid)) return SendClientMessage(playerid, COLOR_RED,"You Must Be Admin!!!");
		}
		return 1;
	}
}
i added for(new playerid=0; playerid<MAX_PLAYERS; playerid++) , dunno if it works havent tested it/
edit: sry i forgot somethig.. post updated
Reply
#4

Quote:
Originally Posted by Swift_
Change
pawn Код:
SetTimer("zadm", 3000, 1);
to
pawn Код:
SetTimerEx("zadm", 3000, 1, "i", playerid);
thanks , swift, but i get:
Код:
C:\Documents and Settings\^^\My Documents\NikeRaptor\filterscripts\xadmin.pwn(47) : error 017: undefined symbol "playerid"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Reply
#5

Oh yeah, that's because OnGameModeInit doesn't have a playerid param. Use gamer_z's code, BUT make sure you change all the 'playerid''s in the callback to 'i'.
Reply
#6

Quote:
Originally Posted by gamer_Z
or try this:
Код:
//init
gate1 = CreateObject(971, 2916.6887, -791.7552, 13.6093, 0.0000, 0.0000, 270.0000);
gate2 = CreateObject(971, 2916.6934, -785.8185, 13.6021, 0.0000, 0.0000, 270.0000);
gate3 = CreateObject(971, 2919.5332, -826.4330, 14.3749, 0.0000, 0.0000, 270.0000);
SetTimer("zadm",3000,1);
//down
forward zadm();
public zadm()
{
	for(new i=0; i<MAX_PLAYERS; i++)
	{
		if(PlayerToPoint(15.0, playerid,2909.1292, -790.3306, 10.2547)&& OpenGate1[playerid] == false)
		{
			if(IsPlayerXAdmin(playerid)) return OpenGate1[playerid] = true,
			MoveObject(gate1, 2916.7163, -791.7419, 0.4390, 2.0),
			MoveObject(gate2, 2916.6914, -785.7935, 0.3271, 2.0),
			GameTextForPlayer(playerid, "Welcome", 5000, 3);
			if (!IsPlayerXAdmin(playerid)) return SendClientMessage(playerid, COLOR_RED,"You Must Be Admin!!!");
		}else if(!PlayerToPoint(15.0, playerid,2909.1292, -790.3306, 10.2547)&& OpenGate1[playerid] == true)
		{
			if(IsPlayerXAdmin(playerid))return OpenGate1[playerid] = false,
			MoveObject(gate1, 2916.6887, -791.7552, 13.6093, 2.0),
			MoveObject(gate2, 2916.6934, -785.8185, 13.6021, 2.0);
			if(!IsPlayerXAdmin(playerid))return SendClientMessage(playerid, COLOR_RED,"You Must Be Admin!!!");
		}
		//poarta2
		if(PlayerToPoint(15.0, playerid,2938.6484,-826.6721,11.7429)&& OpenGate2[playerid] == false)
		{
			if(IsPlayerXAdmin(playerid)) return OpenGate2[playerid] = true,
			MoveObject(gate3, 2919.5359, -826.4325, 6.5434, 2.0),
			GameTextForPlayer(playerid, "Bye!", 5000, 3);
			if(IsPlayerCommandLevel(playerid,"0"))return SendClientMessage(playerid, COLOR_RED,"You Must Be Admin!!!");
		}else if(!PlayerToPoint(15.0, playerid,2938.6484,-826.6721,11.7429)&& OpenGate2[playerid] == true)
		{
			if(IsPlayerXAdmin(playerid))return OpenGate2[playerid] = false,
			MoveObject(gate3, 2919.5332, -826.4330, 14.3749, 2.0);
			if(!IsPlayerXAdmin(playerid)) return SendClientMessage(playerid, COLOR_RED,"You Must Be Admin!!!");
		}
		return 1;
	}
}
i added for(new i=0; i<MAX_PLAYERS; i++) , dunno if it works havent tested it/

look what i get:
Код:
C:\Documents and Settings\^^\My Documents\NikeRaptor\filterscripts\xadmin.pwn(1390) : error 017: undefined symbol "playerid"
C:\Documents and Settings\^^\My Documents\NikeRaptor\filterscripts\xadmin.pwn(1392) : error 017: undefined symbol "playerid"
C:\Documents and Settings\^^\My Documents\NikeRaptor\filterscripts\xadmin.pwn(1392) : error 017: undefined symbol "playerid"
C:\Documents and Settings\^^\My Documents\NikeRaptor\filterscripts\xadmin.pwn(1396) : error 017: undefined symbol "playerid"
C:\Documents and Settings\^^\My Documents\NikeRaptor\filterscripts\xadmin.pwn(1396) : error 017: undefined symbol "playerid"
C:\Documents and Settings\^^\My Documents\NikeRaptor\filterscripts\xadmin.pwn(1397) : error 017: undefined symbol "playerid"
C:\Documents and Settings\^^\My Documents\NikeRaptor\filterscripts\xadmin.pwn(1399) : error 017: undefined symbol "playerid"
C:\Documents and Settings\^^\My Documents\NikeRaptor\filterscripts\xadmin.pwn(1399) : error 017: undefined symbol "playerid"
C:\Documents and Settings\^^\My Documents\NikeRaptor\filterscripts\xadmin.pwn(1402) : error 017: undefined symbol "playerid"
C:\Documents and Settings\^^\My Documents\NikeRaptor\filterscripts\xadmin.pwn(1402) : error 017: undefined symbol "playerid"
C:\Documents and Settings\^^\My Documents\NikeRaptor\filterscripts\xadmin.pwn(1405) : error 017: undefined symbol "playerid"
C:\Documents and Settings\^^\My Documents\NikeRaptor\filterscripts\xadmin.pwn(1407) : error 017: undefined symbol "playerid"
C:\Documents and Settings\^^\My Documents\NikeRaptor\filterscripts\xadmin.pwn(1407) : error 017: undefined symbol "playerid"
C:\Documents and Settings\^^\My Documents\NikeRaptor\filterscripts\xadmin.pwn(1410) : error 017: undefined symbol "playerid"
C:\Documents and Settings\^^\My Documents\NikeRaptor\filterscripts\xadmin.pwn(1410) : error 017: undefined symbol "playerid"
C:\Documents and Settings\^^\My Documents\NikeRaptor\filterscripts\xadmin.pwn(1411) : error 017: undefined symbol "playerid"
C:\Documents and Settings\^^\My Documents\NikeRaptor\filterscripts\xadmin.pwn(1413) : error 017: undefined symbol "playerid"
C:\Documents and Settings\^^\My Documents\NikeRaptor\filterscripts\xadmin.pwn(1413) : error 017: undefined symbol "playerid"
C:\Documents and Settings\^^\My Documents\NikeRaptor\filterscripts\xadmin.pwn(1415) : error 017: undefined symbol "playerid"
C:\Documents and Settings\^^\My Documents\NikeRaptor\filterscripts\xadmin.pwn(1415) : error 017: undefined symbol "playerid"
C:\Documents and Settings\^^\My Documents\NikeRaptor\filterscripts\xadmin.pwn(1419) : warning 209: function "zadm" should return a value
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


20 Errors.
Reply
#7

Read my above post.
Reply
#8

sry for that little error LOL... i had some big hurry xD

BTW:
if u still get after changing the playerid's to i (or the i to playerid xD)
the error/waring
warning 209: function "zadm" should return a value

then where you see at the bottom
return1;
}
}
change it to
return 1;
}
return 1;
}
Reply
#9

thx aall!!! compiled good now i go to test it!
Reply
#10

I am also happy, let us know if it works :]
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)