What is wrong

Started by Mahmut_T7, Jul 29, 2019, 01:29 AM

Previous topic - Next topic

Mahmut_T7

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

Böl ve yönet

KrOoB_

#1
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

Mahmut_T7

doru dion ama bu seferde

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

hatası verdi aynı gonumda
Böl ve yönet

KrOoB_

#3
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();
}

Mahmut_T7

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ı
Böl ve yönet

MatheuS

English please, read the forum rules
if( !sucess ) tryAgain();
Thanks to the VCMP community. It was the happiest period of my life.

KrOoB_

Sorry I change my replies