[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
#2

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...
Reply
#3

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
Reply
#4

pity i don't understand the use of HTTP function

but it could be used for a playername logger or something
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)