Vice City: Multiplayer

VC:MP Discussion => Support => Topic started by: Nihongo^ on Sep 16, 2018, 01:09 PM

Title: Property system bug
Post by: Nihongo^ on Sep 16, 2018, 01:09 PM
I am trying to add Basic property system  on my script  https://forum.vc-mp.org/?topic=4503.0

but i am getting error here also can you guys explain "typeoff" ?
Thanks for your time guys really appreciate if your help me

(https://s15.postimg.cc/px9svkpsb/Untitled.png)
Title: Re: Property system bug
Post by: Nihongo^ on Sep 16, 2018, 01:10 PM
For clear picture
https://postimg.cc/image/lbdon8493/
Title: Re: Property system bug
Post by: ! on Sep 16, 2018, 02:05 PM
Use IsNum( arg )
if ( !IsNum( text ) ) return print( "Error >> Expected an integer." );


typeof
It returns the name of type to which the passed argument belongs.
Title: Re: Property system bug
Post by: Nihongo^ on Sep 16, 2018, 04:30 PM
Hi thanka for your kind reply
I am sorry I am noon in scripting just started recently
 I replace it with numtok kindly check the code o think I did it wrong can u correct it if you don't mind

else if( typeof( IsNum( text, " ", 1 ).tointeger() ) != "integer" ) return pMSG( "Error - Usually 'price' means numbers...", player );
Title: Re: Property system bug
Post by: ! on Sep 16, 2018, 07:17 PM
Quote from: Nihongo^ on Sep 16, 2018, 04:30 PMHi thanka for your kind reply
I am sorry I am noon in scripting just started recently
 I replace it with numtok kindly check the code o think I did it wrong can u correct it if you don't mind

else if( typeof( IsNum( text, " ", 1 ).tointeger() ) != "integer" ) return pMSG( "Error - Usually 'price' means numbers...", player );

Correct
else if( !IsNum( GetTok( text, " ", 1 ) ) ) return pMSG( "Error - Usually 'price' means numbers...", player );