SA-MP Forums Archive
[Include] EX Vars - Set PVars by a web content [SAMP 0.3b] - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+---- Forum: Includes (https://sampforum.blast.hk/forumdisplay.php?fid=83)
+---- Thread: [Include] EX Vars - Set PVars by a web content [SAMP 0.3b] (/showthread.php?tid=167167)



EX Vars 0.1 - Set PVars by a web content [SAMP 0.3b] - Executi0n - 11.08.2010

Hello people since the 0.3b released, I decided to make a little include which is kinda helpful (sometimes).

Before I start explaining about this include, check this link: https://sampwiki.blast.hk/wiki/HTTP, thanks to wiki, all the include content is from there. (EX is a shortcut of my nickname Executi0n)

Functions ID - the ID of the player you would like to change his PVar.
varname - The PVar's name of the ID (string)
url - The URL to "grab" a content and replace the PVar with it (string)

Example of usage
It's very easy actually

OnPlayerConnect:
pawn Code:
SetPVarString(playerid, "ThisIsMyName", "Nothing changed yet");
OnPlayerCommandText:
pawn Code:
if(strcmp(cmd, "/changeit", true) == 0)
    {
        EX_SetPVarString(playerid, "ThisIsMyName", "www.killerchutney.com/hello.txt")
        return 1;
    }
pawn Code:
if(strcmp(cmd, "/check", true) == 0)
    {
        new str[256];
        GetPVarString(playerid, "ThisIsMyName", str, 256);
        SendClientMessage(playerid, 0xFFFFFF, str);
        return 1;
    }
After you'll do /changeit, the PVar (ThisIsMyName) you've selected to change will be changed to the content of the website (www.killerchutney.com/hello.txt)

Of course you may use it in timers and wherever you want. it's useful for the ones who want to control their server through a website, and can easily change a player var.

Known bugs / issues
Reply here if you found a bug / issues that should be fixed



Download Link

Download link - http://www.multiupload.com/75UN8VSL0K
SA-MP 0.3b Windows - http://www.sa-mp.com/stuff/03bRC/sam...C1_1_win32.zip
SA-MP 0.3b Linux - http://www.sa-mp.com/stuff/03bRC/sam...r_RC1_1.tar.gz


You MUST have sa-mp 0.3b RC server files or else the includes won't work.


----------------------------------------------------------------------------------------
This include is pretty easy to make, it's not one of the advanced.

See ya'!


Re: EX Vars - Set PVars by a web content [SAMP 0.3b] - legodude - 11.08.2010

Quote:

This include is pretty easy to make, it's not one of the advanced.

it may be easy but its good inspiration for people to make their own http functions and so on with it...


Re: EX Vars - Set PVars by a web content [SAMP 0.3b] - Executi0n - 11.08.2010

Quote:
Originally Posted by legodude
View Post
it may be easy but its good inspiration for people to make their own http functions and so on with it...
That's right, I must agree with that. thanks for the response


Re: EX Vars - Set PVars by a web content [SAMP 0.3b] - legodude - 11.08.2010

pity i don't understand the use of HTTP function

but it could be used for a playername logger or something