How to detect if a player has a custom object? -
ғαιιοцт - 16.01.2011
Hello,
If you have created a custom.img and you want people to download it so that they can see new objects in your server,
is it possible then to detect if they have downloaded the custom.img?
so something like IsValidObjectForPlayer(playerid, objectid); ?
Re: How to detect if a player has a custom object? -
Toreno - 16.01.2011
Yes... that could be an option, I guess.
You need add a new object from your own, and then you can detect.
Just guessing, because it sounds possible.
Re: How to detect if a player has a custom object? -
ғαιιοцт - 16.01.2011
maybe I can create a custom object at onplayerconnect, and put the player On that object.
then check if their position has changed, if so, they are falling, which means they don't have the custom object
but that's not a real good way to check it haha
is there any other way?
Re: How to detect if a player has a custom object? -
Toreno - 16.01.2011
You can do something like this under OnPlayerConnet;
It may be work, never tried...
pawn Код:
if(!IsValidPlayerObject(playerid, objectid))
{
SendClientMessage(...);
Kick(playerid);
}
else DestroyPlayerObject(playerid, objectid);
Re: How to detect if a player has a custom object? -
ғαιιοцт - 16.01.2011
IsValidPlayerObject(playerid, objectid) doesn't exist,
it was just a suggestion to add this.
Re: How to detect if a player has a custom object? -
Toreno - 16.01.2011
It does; take...
https://sampwiki.blast.hk/wiki/IsValidPlayerObject
That makes your problem easier, I guess...
Because it seems like you didn't know this. I also didn't know, was looking for and booom.
There is a function such as this, good luck.
Re: How to detect if a player has a custom object? -
ғαιιοцт - 16.01.2011
oh!
so does it also return false for a player that Doesn't have your custom.img file?
and returns true for a usually invalid id, but that is now valid because you added it to the custom.img file?
Re: How to detect if a player has a custom object? -
Toreno - 16.01.2011
I think it is;
pawn Код:
Returns 1 if the object exists, 0 if not.
Well, you can try... and If you need help by checking if it works.
Like I'll connect to your server without your COSTUM.
If you need help, I am here.
Re: How to detect if a player has a custom object? -
ғαιιοцт - 16.01.2011
I don't really need help for checking, because I can just delete my own custom.img
I just tested it:
it always returns True
because when the object is invalid, a "question mark object" will be created, which is also a valid object.
Re: How to detect if a player has a custom object? -
Toreno - 16.01.2011
Quote:
Originally Posted by ғαιιοцт
I don't really need help for checking, because I can just delete my own custom.img
I just tested it:
it always returns True
because when the object is invalid, a "question mark object" will be created, which is also a valid object.
|
And can't you use my little example? even if it shows "question mark object" (means invalid)... kick the player then.
Or whatever you wanted to.
Try that..