[Include] EX Vars - Set PVars by a web content [SAMP 0.3b]
#1

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
  • EX_SetPVarString(id, varname[], url[])
  • EX_SetPVarInt(id, varname[], url[])
  • EX_SetPVarFloat(id, varname[], url[])
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'!
Reply


Messages In This Thread
EX Vars 0.1 - Set PVars by a web content [SAMP 0.3b] - by Executi0n - 11.08.2010, 13:07
Re: EX Vars - Set PVars by a web content [SAMP 0.3b] - by legodude - 11.08.2010, 13:21
Re: EX Vars - Set PVars by a web content [SAMP 0.3b] - by Executi0n - 11.08.2010, 13:30
Re: EX Vars - Set PVars by a web content [SAMP 0.3b] - by legodude - 11.08.2010, 13:47

Forum Jump:


Users browsing this thread: 1 Guest(s)