AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [SMA] Get url Contained (https://forums.alliedmods.net/showthread.php?t=244357)

DeVe 07-17-2014 06:36

[SMA] Get url Contained
 
Hi Alliedmods team, Users

I know php lang but amxx will get me hard to complete some of my project.

I try to explain you whit my words and my idea .

#include <amxmodx>
#include <amxmisc>

new postCvar[64]
new const urlGET[ ] = "http://domain.ro/geturl.php?download="
new const geturl = urlGET + postCvar

public plugin_init()
{
register_plugin(PLUGIN_NAME, VERSION, AUTHOR)
postCvar = register_cvar("postcvar","1")
Verify_Cvar();
}
public Verify_Cvar()
{
if(geturl == 1)
{
console_print ("Cvarul inregistrat este valid);
}
else
{
console_print ("Cvar inregistrat nu este valid");
}
}

So here is my request to be make.

I want a plugin to auth whit my link.

Now first I want to register a cvar on amxx.cfg
Next I want this cvar to add whit new const urlGET[ ] = "http://domain.ro/geturl.php?download="

and I will get

http://domain.ro/geturl.php?download=cvar

If in amxx.cfg will put
postcvar "alliedmods"

the url will be http://domain.ro/geturl.php?download=alliedmods

Now When the urlGET + postcvar will get contained 1 will be TRUE if will be 0 will be FALSE !

Thank you and I hope you to understand.

I know only php and it`s new for me and I want to learn .

Black Rose 07-17-2014 12:29

Re: [SMA] Get url Contained
 
Are you using it as an authentication to prevent users who have not purchased your plugin from using it?

DeVe 07-17-2014 12:33

Re: [SMA] Get url Contained
 
No I do not use for user. I want to secure my plugin :)

Black Rose 07-17-2014 13:28

Re: [SMA] Get url Contained
 
Don't share it: protected.

DeVe 07-17-2014 13:53

Re: [SMA] Get url Contained
 
Black thanks but I do not need a advice .

I just open this Scripting help to learn and to make what I want :D

Thank you

Black Rose 07-17-2014 15:27

Re: [SMA] Get url Contained
 
Okay. You can use the sockets module to send HTTP requests. There are some examples you can search for and 2 includes to ease the work.
In your situation it seems like SQL can do the work as well. You should look into that as it is generally more reliable.

DeVe 07-17-2014 15:45

Re: [SMA] Get url Contained
 
I found for moment a good solution !

Thank you for guide me.

Regards,
Cristian G.

fysiks 07-17-2014 16:14

Re: [SMA] Get url Contained
 
Just remember that the only reliable method to protect your plugin is to not give it to anyone.

DeVe 07-17-2014 17:31

Re: [SMA] Get url Contained
 
Ok I will remeber :D

If someone can help me I have some issues here :|

L 07/18/2014 - 00:23:16: Test: domain/geturl?download= postcvar

this is the log of my test.

I try to put domanin + geuturl= postcvar

The problemes is the space of geturl="HERE"postcvar

My test is:

#include <amxmodx>
#include <amxmisc>
#include <sockets>
new g_Socket,cvar,msg2[32];
public plugin_init( )
{
register_plugin(PLUGIN_NAME, VERSION, AUTHOR)
cvar= register_cvar("post_cvar","cvartest")
get_pcvar_string(CheckLicense,msg2,32)
SendRequest();
}
public SendRequest()
{
My code
}

How can I set geturl="HERE"postcvar do not be space into ="SPACE"

I thinks is here msg2[32];

Black Rose 07-17-2014 17:50

Re: [SMA] Get url Contained
 
What?


All times are GMT -4. The time now is 13:13.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.