playerid OnObjectMoved
#1

Hello is there any way to make this working?

Код:
new Nuke[MAX_PLAYERS];//variable for any player

public OnObjectMoved(objectid)
{
	if(objectid==Nuke[playerid)
	{
		//do something
	}
	return 1;
}
But as it should be i getting this error:

Код:
error 017: undefined symbol "playerid"
Now, is there any way to use playerid in this callback?

Thanks
Reply
#2

Try this:

new Nuke[MAX_PLAYERS];

public OnObjectMoved(objectid)
{
for(new i; i<MAX_PLAYERS; i++)
if(objectid==Nuke[i])
{
//do something
}
return 1;
}
Reply
#3

Quote:
Originally Posted by zofa
Посмотреть сообщение
Hello is there any way to make this working?

Код:
new Nuke[MAX_PLAYERS];//variable for any player

public OnObjectMoved(objectid)
{
	if(objectid==Nuke[playerid)
	{
		//do something
	}
	return 1;
}
But as it should be i getting this error:

Код:
error 017: undefined symbol "playerid"
Now, is there any way to use playerid in this callback?

Thanks
So basicly you want to compare a player's id with an moved object's id?
Reply
#4

Quote:
Originally Posted by Kmitska
Посмотреть сообщение
Try this:

new Nuke[MAX_PLAYERS];

public OnObjectMoved(objectid)
{
for(new i; i<MAX_PLAYERS; i++)
if(objectid==Nuke[i])
{
//do something
}
return 1;
}
It work, thank you
Reply
#5

Iuri, he also did it

Quote:

if(objectid==Nuke[playerid)

Reply
#6

Use player objs for this
pawn Код:
new Nuke[MAX_PLAYERS];//variable for any player

public OnPlayerObjectMoved(playerid,objectid)
{
    if(objectid==Nuke[playerid)
    {
        //do something
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)