Register text.
#1

Hey guys im looking for someone who can make a script so that when someone logs on a text apairs like : A total of x people have registers on the server .

CAn you help me? Rep+++ i even will pay real money for the golden tip
Reply
#2

You just need 2 functions:

PHP код:
stock GetRegisteredPeople()
{
    if(!
fexist("reg.txt")) return 0;
    new 
File:f=fopen("reg.txt"),str[64];
    return 
fread(f,str),fclose(f),strval(str);
}
stock SetRegister(x)
{
    new 
File:f=fopen("reg.txt"),str[64];
    return 
valstr(str,x),fwrite(f,str),fclose(f);
}
//If a player register:
SetRegister(GetRegisteredPeople()+1);
//If you wanna know how many people registered
new str[64];
format(str,sizeof(str),"On the server registered %d people!",GetRegisteredPeople());
SendClientMessage(playerid,-1,str); 
//Edit:
Or you just count all accounts...
If you use mysql just count the rows...
If you use an ini file system like (dini/yini/...) use a file plugin

Greekz
Reply
#3

Quote:
Originally Posted by Kaliber
Посмотреть сообщение
You just need 2 functions:

PHP код:
stock GetRegisteredPeople()
{
    if(!
fexist("reg.txt")) return 0;
    new 
File:f=fopen("reg.txt"),str[64];
    return 
fread(f,str),fclose(f),strval(str);
}
stock SetRegister(x)
{
    new 
File:f=fopen("reg.txt"),str[64];
    return 
valstr(str,x),fwrite(f,str),fclose(f);
}
//If a player register:
SetRegister(GetRegisteredPeople()+1);
//If you wanna know how many people registered
new str[64];
format(str,sizeof(str),"On the server registered %d people!",GetRegisteredPeople());
SendClientMessage(playerid,-1,str); 
Greekz
Thanks so much! My registerd players apaire in the luxadmin folder? Do i need to change anything in the code?
Reply
#4

Quote:
Originally Posted by Tixxt
Посмотреть сообщение
Thanks so much! My registerd players apaire in the luxadmin folder? Do i need to change anything in the code?
A file will be created in the scriptfiles.

And no, you don't need to change anything
Reply
#5

How do i get the script working? Im kind of a noob in scripting these scripts..
Reply
#6

Please i need someone that knows how to do this
Reply
#7

What you dont understand?

...should work fine...just read the comments...
Reply
#8

no but i never put in a script... What do i need to do to make it work? do i need to make a pwn?
Reply
#9

It would be awesome if someone could give a explanation.
Reply
#10

Well...

yes you should open the script (.pwn) and then put the functions (stock ...) at the end of the script and then look where the registration is..and put the things there...

Look how the script is organized
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)