IF no PVarInt
#1

Is there a possibility to query IF there is NO SetpVariant at this Name

For example

SetPVarInt(playerid,"Player",playerid); If this PVariant DOESNT exist THAN ....
Reply
#2

Refer to the documentation on the wiki:

https://sampwiki.blast.hk/wiki/GetPVarInt

Quote:

Return Values:
The integer value of the specified player variable. It will still return 0 if the variable is not set, or the player does not exist.
Reply
#3

Quote:
Originally Posted by Sithis
Посмотреть сообщение
Refer to the documentation on the wiki:

https://sampwiki.blast.hk/wiki/GetPVarInt
example please
Reply
#4

Quote:
Originally Posted by pulsare
Посмотреть сообщение
example please
Quote:

It will still return 0 if the variable is not set, or the player does not exist.

Learn how to use functions... Examples won't teach you shit.
Reply
#5

Quote:
Originally Posted by Sew_Sumi
Посмотреть сообщение
Learn how to use functions... Examples won't teach you shit.
I dont wanna get TEACHED I want the SOLUTION
Reply
#6

Код:
if(GetPVarInt(playerid, "Player") == 0)
Reply
#7

Quote:
Originally Posted by pulsare
Посмотреть сообщение
I dont wanna get TEACHED I want the SOLUTION
So you are in the wrong section. We help people to script by teaching how to get solution, we don't give any direct solutions. There is no interest. If you face again on the problem, you will ask again for the solution instead of solving the problem by yourself.
Reply
#8

^^ This is why... If you're spoonfed the code/'example' you'll not learn anything, and the next hurdle you'll just be back here asking the exact same thing, for another 'example'.

Don't use Daveosss example. You don't use that as if you set Int to 0, it's valid...

https://sampwiki.blast.hk/wiki/GetPVarType

GetPVarType will give you the type of variable, of which 0 is none.

Код:
if(GetPVarType(playerid, "Player") == 0)
This is more a reason on why having people throw code to you, isn't a good idea as chances are a lot of it is incorrect, compared to the drive to get +rep.

Really hope you didn't rep Daveosss...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)