Vice City: Multiplayer

VC:MP Discussion => Support => Topic started by: Mahmut_T7 on Jul 29, 2019, 01:29 AM

Title: What is wrong
Post by: Mahmut_T7 on Jul 29, 2019, 01:29 AM
https://prnt.sc/ol9lyr
https://prnt.sc/ol9lqi
https://prnt.sc/ol9m3q

Code

[spoiler]  if ( key == G )
 {
 if ( DistanceFromPoint( player.Pos.x, player.Pos.y ,-386.767, -569.178 ) < 2 )
{
if ( stats[ player.ID ].kumaroyna )
{
 player.IsFrozen = true;
 player.Cash -= 100;
    MessagePlayer( "[#ffffff]Tutturamadiysaniz Tekrar deneyebilirsiniz " , player );
 if ( RandomFloatUpto(12.4) > 11 )
{
    stats[ player.ID ].kumaroyna = false;
       NewTimer("kumardevam", 4000, 1, player.ID);
   MessagePlayer( "[#ffffff]Sayin " + player.Name + " ,[#ffffff]3 RAKAMIDA TUTTURDUNUZ ! ODUL 1000 DOLAR " , player );
    MessagePlayer( "[#ffffff]Sayin " + player.Name + " ,[#ffffff]3 RAKAMIDA TUTTURDUNUZ ! ODUL 1000 DOLAR " , player );
    MessagePlayer( "[#ffffff]Sayin " + player.Name + " ,[#ffffff]3 RAKAMIDA TUTTURDUNUZ ! ODUL 1000 DOLAR " , player );
 player.Cash += 1000;
}
}
}
if (  !stats[ player.ID ].kumaroyna )
{
    MessagePlayer( "[#ffffff]Sanananananananana " + player.Name + " ,[#ffffff]3 RAKAMIDA TUTTURDUNUZ ! ODUL 1000 DOLAR " , player );
}
}


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

class PlayerClass
{
 kumaroyna = true;
}
------------------------
Cmd error ( 3656 is from keydown part , it cant understand class )

AN ERROR HAS OCCURED [the index 'kumaroyna' does not exist]

CALLSTACK
*FUNCTION [onKeyDown()] scripts/main.nut line [3656]

LOCALS
[C_VIEWLOC] INSTANCE
[mapSave] TABLE
[player] INSTANCE
[key] 5
[plr] INSTANCE
[this] TABLE
[/spoiler]

Where is problem

Title: Re: What is wrong
Post by: KrOoB_ on Jul 29, 2019, 01:40 AM
hatanın nedeni bence orda durumunu belirtmemişsin if'ten sonra (eğer kumaroyna = true; ise gibi olmalı yani
I think u need spesicft the situation like ( kumaroyna = true) So your code must be like this
if ( stats[player.ID].kumaroyna = true)
if'le oluşan fonksiyonlara bakabilirsin :)
u can take a look for if codes
Title: Re: What is wrong
Post by: Mahmut_T7 on Jul 29, 2019, 02:40 AM
doru dion ama bu seferde

AN ERROR HAS OCCURED [the index 'kumaroyna' does not exist]

hatası verdi aynı gonumda
Title: Re: What is wrong
Post by: KrOoB_ on Jul 29, 2019, 02:52 AM
Mohamed account system kullanıyosun dimi eğer öyleyse şu satır olduğuna emin ol
Are u sure using Mohamed Account System if u using it u have to check this code
function onPlayerJoin( player )
{
stats[player.ID] = PlayerClass();
}
Title: Re: What is wrong
Post by: Mahmut_T7 on Jul 29, 2019, 12:14 PM
Quote from: KrooB on Jul 29, 2019, 02:52 AMMohamed account system kullanıyosun dimi eğer öyleyse şu satır olduğuna emin ol

function onPlayerJoin( player )
{
stats[player.ID] = PlayerClass();
}
Teşekkurler çalıştı
Title: Re: What is wrong
Post by: MatheuS on Jul 29, 2019, 12:14 PM
English please, read the forum rules
Title: Re: What is wrong
Post by: KrOoB_ on Jul 29, 2019, 02:45 PM
Sorry I change my replies