[Plugin] GVar Plugin
#61

Quote:
Originally Posted by Sergei
Посмотреть сообщение
Hmm, haven't even thought that way, but it seems like a good solution.

----------------------------------------------------------------------
I made some tests now.

pawn Код:
COMMAND:test(playerid,params[])
{
    new tick = GetTickCount();
    for(new i=0; i<100000; i++)
    {
      SetPVarInt(playerid,"RandomID",i);
    }
    printf("tick #1: %d",GetTickCount() - tick);
   
    tick = GetTickCount();
    for(new i=0; i<100000; i++)
    {
      GetPVarInt(playerid,"RandomID");
    }
    printf("tick #2: %d",GetTickCount() - tick);
   
    tick = GetTickCount();
    for(new i=0; i<100000; i++)
    {
      SetGVarInt("RandomID",i);
    }
    printf("tick #3: %d",GetTickCount() - tick);
   
    tick = GetTickCount();
    for(new i=0; i<100000; i++)
    {
      GetGVarInt("RandomID");
    }
    printf("tick #4: %d",GetTickCount() - tick);
   
    tick = GetTickCount();
    for(new i=0; i<100000; i++)
    {
      SOMETHING[randomshit] = i;
    }
    printf("tick #5: %d",GetTickCount() - tick);
   
    tick = GetTickCount();
    for(new i=0; i<100000; i++)
    {
      i = SOMETHING[randomshit];
    }
    printf("tick #6: %d",GetTickCount() - tick);
    return 1;
}
Results:
[20:45:01] tick #1: 38
[20:45:01] tick #2: 33
[20:45:01] tick #3: 102
[20:45:01] tick #4: 100
[20:45:01] tick #5: 12
[20:45:01] tick #6: 2

I don't know anything about plugin programming, but could this be somehow speeded up a bit? GVars seem to be around three times slower than PVars.
Whoa so

i = SOMETHING[randomshit];

is like 5 times faster than

SOMETHING[randomshit] = i;


Whoa. i gotta go inverse my scripts now

EDIT: i ran a test to comfirm this and server made cp usage reach 100% with no result(epic crash) and then running further tests i discovered it doesnt work if its like
Код:
i = SOMETHING[5];
(i used an array of 50 size)

and if i put a number there instead pawno compiler gives an error, but like this: SOMETHING[5] = z; it works even if i put a number on it. I guess something went wrong >.>

EDIT2: i figured it lol im an ass --ґ first one tried to se i to the value of SOMETING[5] and second sets SOMETHING[5] to the value of z(i just replaced i by z).
Reply
#62

Please update for 0.3d scripting!
Reply
#63

Quote:
Originally Posted by kurta999
Посмотреть сообщение
Why ?

It works without any problem with 0.3d!
4char
Reply
#64

Quote:
Originally Posted by kurta999
Посмотреть сообщение
4char
It not work with Linux server
Reply
#65

Quote:
Originally Posted by NeyMar96
Посмотреть сообщение
It not work with Linux server
For me works without any problem.
Try this.
Reply
#66

reapload please
Reply
#67

the "mirror" link works -> http://www.mediafire.com/?btghxl6jgbr4431
Reply
#68

Please update for 0.3e. Plugin does not work on 0.3e...
Reply
#69

Work without any problem with "all SA-MP versions".
I use this with 0.3e and no problems..
Reply
#70

Can't you take advantage of the ID parameter in the functions to simplify your code even more?
Reply
#71

Quote:
Originally Posted by AndreT
Посмотреть сообщение
Can't you take advantage of the ID parameter in the functions to simplify your code even more?
If that question was for me, I have already used index parameter (50 first things with 100 things included in every first thing :P)
PHP код:
format(str,64,"EventInfo[%d][PIDPlace][%d]",RaceStartZone[playerid],i);
apid GetGVarInt(str,JoinedJNum[playerid]); 
Reply
#72

Why do we need a name if there's already an ID? It only makes me write more

Edit: Wait, is it optional?
Reply
#73

Link is dead, page can't be found after "Download"
Can somebody reupload this somewhere?

@EDIT
I found it, new link: https://www.dropbox.com/s/tjmtbwqjg2...lugin_v1_3.zip

@DOWN
For me solidfiles is still dead, mediafire now works.
Reply
#74

Quote:
Originally Posted by Quis
Посмотреть сообщение
Link is dead, page can't be found after "Download"
Can somebody reupload this somewhere?

@EDIT
I found it, new link: https://www.dropbox.com/s/tjmtbwqjg2...lugin_v1_3.zip
Both SolidFiles and Mediafire link works for me.
Reply
#75

This plugin isn't working for me in 0.3z R2-2
Reply
#76

Quote:
Originally Posted by SlonCHL
Посмотреть сообщение
This plugin isn't working for me in 0.3z R2-2
How is it not working? It will work perfectly with any previous or future SA-MP releases.
Reply
#77

This plugin is awesome!
Reply
#78

http://forum.sa-mp.com/showthread.ph...91#post3060991

Not sure why is it happening, can anyone help?
Reply
#79

Please add GetGVarIndexAtName.

Example: If I have gvar with MapName, i already added 500 elements into it, then I can't delete it with every elements. Because I can't get upper id from name.
Reply
#80

Quote:
Originally Posted by SlonCHL
Посмотреть сообщение
http://forum.sa-mp.com/showthread.ph...91#post3060991

Not sure why is it happening, can anyone help?
it's the include dude.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)