Few questions
#1

Hi,

Lets say that I have deleted Something PVar of thatplayer.
Now I am going to use GetPVarInt(thatplayer, "Something")
What will it return?


------------------------------------------------

And how do I check if thatplayer doesn't have PVar called Something?
Can I use if(GetPVarInt(thatplayer, "Something") == IsValidPlayerID(playerid))
Because this PVar would only store ID's.


If I would have 200 slots then this would work right? :
stock IsValidPlayerID(playerid)
{
if(playerid < 199 && playerid >= 0) return true; return false;
}
Reply
#2

If a PVar doesn't exist it returns 0, which is a possible ID.
I would advise that you simply add 1 to your pVar when storing it(So the range would be 1->500 instead of 0->499) and removing it again when you use GetPVarInt
Reply
#3

Quote:
Originally Posted by jonrb
Посмотреть сообщение
If a PVar doesn't exist it returns 0, which is a possible ID.
I would advise that you simply add 1 to your pVar when storing it(So the range would be 1->500 instead of 0->499) and removing it again when you use GetPVarInt
Thank, so there is other way to check if PVar exists?
I think that instead of deleting it I would SetPVarString(playerid,"Something",STRING); and then check for it and if it exists then return 0.

Oh, btw. is there any option to make a player not to drown. Something with lung capacity?

Thanks.
Reply
#4

Quote:
Originally Posted by dawidek11
Посмотреть сообщение
Thank, so there is other way to check if PVar exists?
I think that instead of deleting it I would SetPVarString(playerid,"Something",STRING); and then check for it and if it exists then return 0.

Oh, btw. is there any option to make a player not to drown. Something with lung capacity?

Thanks.
https://sampwiki.blast.hk/wiki/GetPVarType
Reply
#5

Quote:
Originally Posted by wups
Посмотреть сообщение
Thanks!

What about drowning?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)