Server update: 0.3a R8
#81

Quote:
Originally Posted by Krozz
Quote:
Originally Posted by Mikep.
Quote:
Originally Posted by Krozz
Your Awesome Kye, I love that you made SA-MP Its just so amazing
Kye doesn't own an awesome.

Good work kye, can't wait for 0.3b.
Are you blind? I said Your Awesome Kye not You Own An awesome Kye
He probaly pointed out the fact that it's spelled you're.
Reply
#82

To get back on topic, I think you've done a GREAT job with this whole PVar idea Kye, so thanx & know its appreciation...

However, I have a question about this PVar system:
Is it possible to convert the following code, for example, to the PVars system at all?

pawn Код:
static Text:textdraw[MAX_PLAYERS];

textdraw[playerid]=TextDrawCreate(0.0,0.0,"Text Draw Example");
Of course this isn't tied down to just Text:, but all others as well (File: & etc.)

Current Version Use: R7
Reply
#83

Yes, you can use:

pawn Код:
SetPVarInt(playerid, "MyTextDraw", _:TextDrawCreate(0.0, 0.0, "Text Draw Example"));
TextDrawShowForPlayer(playerid, Text:GetPVarInt(playerid, "MyTextDraw"));
And you can use this with any tag, like Menu:, DB:, etc.
Reply
#84

Quote:
Originally Posted by Toribio
Yes, you can use:

pawn Код:
SetPVarInt(playerid, "MyTextDraw", _:TextDrawCreate(0.0, 0.0, "Text Draw Example"));
TextDrawShowForPlayer(playerid, Text:GetPVarInt(playerid, "MyTextDraw"));
And you can use this with any tag, like Menu:, DB:, etc.
I really appreciate that Toribio, thanx a million
(That will also help any other concerned scripters too)
Reply
#85

Ok, that is great, but how i can sum up Pvars int like in older version i used
Код:
variable[playerid]=variable[playerid]+1;
so now i have to use that way:

Код:
SetPVarInt(playerid,"variable",GetPVarInt(playerid, "variable")+1;);
?
Reply
#86

Quote:
Originally Posted by oggylt
Код:
SetPVarInt(playerid,"variable",GetPVarInt(playerid, "variable")+1;);
You could use an define.

pawn Код:
#define IncreasePVarInt(%1, %2, %3) SetPVarInt(%1, %2, GetPVarInt(%1, %2)+%3);
Untested, but should work.
Reply
#87

Quote:
Originally Posted by oggylt
Код:
SetPVarInt(playerid,"variable",GetPVarInt(playerid, "variable")+1;);
?
Almost, you got an extra ; in there, so it should be:
Код:
SetPVarInt(playerid,"variable",GetPVarInt(playerid, "variable")+1);
And for some reason, ++ won't work, must be +1
Reply
#88

Quote:
Originally Posted by XGh0stz
Quote:
Originally Posted by oggylt
Код:
SetPVarInt(playerid,"variable",GetPVarInt(playerid, "variable")+1;);
?
Almost, you got an extra ; in there, so it should be:
Код:
SetPVarInt(playerid,"variable",GetPVarInt(playerid, "variable")+1);
And for some reason, ++ won't work, must be +1
Because to my knowledge, GetPVarInt returns the value of the PVar, not the address of the variable itself. In such, you cannot increment a non-existent variable.
Reply
#89

So, i have to set this variable to 0 before setting it +1 ?
Reply
#90

No, It would just add whatever you put...

( +1, +3, +7, etc. )

If you had to set the varible to 0, then the +1 would be rather pointless :P
Reply
#91

i figured it out, and now i'm getting undefined symbol tires= encode_tires(1,1,1,1); when i'm trying to test some poping comands
EDIT:
ok i saw on samp wiki that i shoul use (vehicleid,panels, doors, lights, 15); 15 - all poped tyres;
Reply
#92

How would you point to your PVar String? For example, when using strcmp (String1,String2,true/false,strlen(String1))
GetPVarString doesn't work in this case as it gathers only what is actually in the string, not the string itself...
I know I can pass the PVarString into a temp string to use instead, but is it possible to point directly at the PVarString itself?
There's those PVar Index Functions, but on the wiki it only points to edit the articles (Another words, broken link) [That might be the key to my problem]
Just in case you fail to understand what I mean, then how would I get the following to work:
pawn Код:
new String[256];
if(strcmp(GetPVarString(playerid,"String1",256,String),GetPVarString((playerid,"String2",256,String),false,strlen(GetPVarString((playerid,"String1",256,String))))
Reply
#93

Just make 2 new strings, format them to what String1 and 2 are, then compare the new strings.
Reply
#94

pawn Код:
ReturnPVarString(playerid, string)
{
    teststring[256];
    GetPVarString(playerid,string,teststring,sizeof(teststring))
    return teststring;
}
Untested but should work.
Reply
#95

Anyone else crashing when repeatedly creating and deleting 3D Texts?
Reply
#96

Quote:

I know I can pass the PVarString into a temp string to use instead, but is it possible to point directly at the PVarString itself?

LOL, well thanx anyway guys, I guess that is the only way to do it... I do appreciate the replies though

Joe: I don't mess with the 3D Text Features yet, so wouldn't know, sorry :P
Reply
#97

Just finished converting my admin script to PVars
Reply
#98

Quote:
Originally Posted by [03
Garsino ]
Just finished converting my admin script to PVars
They're actually really nice once you get how they work :P

I made a stats system for one of my GMs with them, works great, the only issue with them is that they're about 8 times slower than normal variables as I read somewhere.
Reply
#99

Quote:
Originally Posted by biltong
Quote:
Originally Posted by [03
Garsino ]
Just finished converting my admin script to PVars
They're actually really nice once you get how they work :P

I made a stats system for one of my GMs with them, works great, the only issue with them is that they're about 8 times slower than normal variables as I read somewhere.
calling 15000 pvar's don't even take 1 second so you wouldn't notice any difference.
Reply

GangZoneCreate returns wrong id
Why?
may be because the zones > 500?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)