To find out who is in range of a point and write them into a variable
#1

Hello I've got an problem and i don't know how to solve this. I already used som things but it don't works
first my script with the problem:
under public OnPlayerCommandText(playerid, cmdtext[])
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp("/RennenS",cmdtext,true)==0||strcmp("/RennenStart",cmdtext,true)==0)
	{
	    if(IsAdmin(playerid,1))
	    {
         if(IsPlayerInRangeOfPoint(playerid,100,-1402.9977,-253.5624,1043.5925))
	        {
             	Playerid = playerid;
             	TogglePlayerControllable(playerid,0);
	        	SetTimer("RennenStart",5000,false);
	        	return 1;
			}
		}
	}
Код:
public RennenStart(playerid)
{
 	SendClientMessage(Playerid,Gelb,"GO GO GO ");
 	SendClientMessage(playerid,Gelb,"GO GO GO ");
	TogglePlayerControllable(playerid,1);
	TogglePlayerControllable(Playerid,1);
	MoveObject(Gate1,-1397.1822509766,-208.0719909668,1046.0936279297,2);
	MoveObject(Gate2,-1406.130859375, -207.99920654297, 1046.0804443359,2);
	MoveObject(Gate3,-1389.2164306641, -258.69665527344, 1046.7403564453,2);
	MoveObject(Gate4,-1398.3095703125, -258.67474365234, 1046.6094970703,2);
	MoveObject(Gate5,-1398.7873535156, -258.57775878906, 1042.5,2);
	MoveObject(Gate6,-1399.8000488281, -249.6667175293, 1042.5,2);
	MoveObject(Gate7,-1401.6646728516, -231.81495666504, 1042.5,2);
	MoveObject(Gate8,-1400.6999511719, -240.77955627441, 1042.5,2);

}
now only the one who uses /rennens will be froozen etc. but not the one who will stand next to him

Thanx for answers/solutions
Reply
#2

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp(cmdtext,"/RennenS",true)==0||strcmp(cmdtext,"/RennenStart",true)==0)
    {
        if(IsAdmin(playerid,1))
        {
         if(IsPlayerInRangeOfPoint(playerid,100,-1402.9977,-253.5624,1043.5925))
            {
                Playerid = playerid; // What's this?
                TogglePlayerControllable(playerid,0);
                SetTimer("RennenStart",5000,false);
                return 1;
            }
        }
        else
        {
            SendClientMessage(playerid,COLOR_RED,"You aren't authorized to use that command.");
            return 1;
        }
    }
Also if 'Rennens' only starts for the Admin then no-one else will join him.
Reply
#3

pawn Код:
if(strcmp("/RennenS",cmdtext,true)==0||strcmp("/RennenStart",cmdtext,true)==0)
{
    if(IsAdmin(playerid, 1)) {
        for(new i; i>MAX_PLAYERS; i++) { if(IsPlayerInRangeOfPoint(playerid,100,-1402.9977,-253.5624,1043.5925)) { TogglePlayerControllable(playerid,1); } }
        SetTimer("RennenStart",5000,false);
    }
    return 1;
}
public RennenStart(playerid)
{
    for(new i; i>MAX_PLAYERS; i++) { if(IsPlayerInRangeOfPoint(playerid,100,-1402.9977,-253.5624,1043.5925)) { SendClientMessage(i,Gelb,"GO GO GO "); TogglePlayerControllable(playerid,1); } }
    MoveObject(Gate1,-1397.1822509766,-208.0719909668,1046.0936279297,2);
    MoveObject(Gate2,-1406.130859375, -207.99920654297, 1046.0804443359,2);
    MoveObject(Gate3,-1389.2164306641, -258.69665527344, 1046.7403564453,2);
    MoveObject(Gate4,-1398.3095703125, -258.67474365234, 1046.6094970703,2);
    MoveObject(Gate5,-1398.7873535156, -258.57775878906, 1042.5,2);
    MoveObject(Gate6,-1399.8000488281, -249.6667175293, 1042.5,2);
    MoveObject(Gate7,-1401.6646728516, -231.81495666504, 1042.5,2);
    MoveObject(Gate8,-1400.6999511719, -240.77955627441, 1042.5,2);
}
Please learn some conventions.
Reply
#4

Quote:
Originally Posted by jameskmonger
Посмотреть сообщение
pawn Код:
if(strcmp("/RennenS",cmdtext,true)==0||strcmp("/RennenStart",cmdtext,true)==0)
{
    if(IsAdmin(playerid, 1)) {
        for(new i; i>MAX_PLAYERS; i++) { if(IsPlayerInRangeOfPoint(playerid,100,-1402.9977,-253.5624,1043.5925)) { TogglePlayerControllable(playerid,0); } }
        SetTimer("RennenStart",5000,false);
    }
    return 1;
}
public RennenStart(playerid)
{
    for(new i; i>MAX_PLAYERS; i++) { if(IsPlayerInRangeOfPoint(playerid,100,-1402.9977,-253.5624,1043.5925)) { SendClientMessage(i,Gelb,"GO GO GO "); TogglePlayerControllable(playerid,1); } }
    MoveObject(Gate1,-1397.1822509766,-208.0719909668,1046.0936279297,2);
    MoveObject(Gate2,-1406.130859375, -207.99920654297, 1046.0804443359,2);
    MoveObject(Gate3,-1389.2164306641, -258.69665527344, 1046.7403564453,2);
    MoveObject(Gate4,-1398.3095703125, -258.67474365234, 1046.6094970703,2);
    MoveObject(Gate5,-1398.7873535156, -258.57775878906, 1042.5,2);
    MoveObject(Gate6,-1399.8000488281, -249.6667175293, 1042.5,2);
    MoveObject(Gate7,-1401.6646728516, -231.81495666504, 1042.5,2);
    MoveObject(Gate8,-1400.6999511719, -240.77955627441, 1042.5,2);
}
Please learn some conventions.
You made the first toggleplayercontrollable 1, he wants him frozen.
Edited.
Reply
#5

Oh thanks, my bad.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)