SA-MP Forums Archive
Server update: 0.3a R8 - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Server (https://sampforum.blast.hk/forumdisplay.php?fid=6)
+--- Forum: Server Support (https://sampforum.blast.hk/forumdisplay.php?fid=19)
+--- Thread: Server update: 0.3a R8 (/showthread.php?tid=136210)

Pages: 1 2 3 4 5 6 7


Re: Server update: 0.3a R7 - [03]Garsino - 02.04.2010

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.


Re: Server update: 0.3a R7 - XGh0stz - 03.04.2010

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


Re: Server update: 0.3a R7 - Toribio - 03.04.2010

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.


Re: Server update: 0.3a R7 - XGh0stz - 03.04.2010

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)


Re: Server update: 0.3a R7 - oggylt - 06.04.2010

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;);
?


Re: Server update: 0.3a R7 - pspleo - 06.04.2010

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.


Re: Server update: 0.3a R7 - XGh0stz - 06.04.2010

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


Re: Server update: 0.3a R7 - Tannz0rz - 06.04.2010

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.


Re: Server update: 0.3a R7 - oggylt - 07.04.2010

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


Re: Server update: 0.3a R7 - XGh0stz - 07.04.2010

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


Re: Server update: 0.3a R7 - oggylt - 07.04.2010

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;


Re: Server update: 0.3a R7 - XGh0stz - 11.04.2010

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))))



Re: Server update: 0.3a R7 - biltong - 11.04.2010

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


Re: Server update: 0.3a R7 - Dark_Kostas - 11.04.2010

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


Re: Server update: 0.3a R7 - Joe Staff - 11.04.2010

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


Re: Server update: 0.3a R7 - XGh0stz - 11.04.2010

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


Re: Server update: 0.3a R7 - [03]Garsino - 11.04.2010

Just finished converting my admin script to PVars


Re: Server update: 0.3a R7 - biltong - 12.04.2010

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.


Re: Server update: 0.3a R7 - shady91 - 12.04.2010

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.


Re: Server update: 0.3a R7 - [JIeXa] - 13.04.2010

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