SA-MP Forums Archive
Registration After 10mins - 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: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Registration After 10mins (/showthread.php?tid=610231)



Registration After 10mins - CarRamper - 21.06.2016

Hello Guys Can i make a registration system that allow player to register a new account after playing on the server for 10 min

pleazse tell me how


Re: Registration After 10mins - CopKing123 - 21.06.2016

Not to be rude to you but this section for "Scripting Help" which means you post your code with problems and we help you find a solution for it, not to script for you.


Re: Registration After 10mins - CarRamper - 21.06.2016

Does i have to give u onplayerconnect


Re: Registration After 10mins - Stinged - 21.06.2016

If you want it to automatically show the player the registration dialog after 10 minutes, set a timer once they connect with an interval of 600000.
If you want it to be a command, create a player variable or use PVars, and set its value to the current timestamp ( gettime() ) and then check if 600 seconds have passed.


Re: Registration After 10mins - CarRamper - 21.06.2016

I Want To Do The Second Option Can u Help Me in Scripting It Stinged


Re: Registration After 10mins - CarRamper - 21.06.2016

I Am Not Having A Register Command In My Script


Re: Registration After 10mins - Jf - 21.06.2016

This is an example.

PHP код:
#define MINUTES 10 // 10 Minutes.
#define MILISECONDS MINUTES * 60
new
    
RegisterTime[MAX_PLAYERS];
public 
OnPlayerConnect(playerid)
{
    
RegisterTime[playerid] = gettime() + MILISECONDS;
    return 
1;
}
CMD:register(playeridparams[])
{
    if(
RegisterTime[playerid] >= gettime())
    {
        new 
Str[128]; format(Str128"REGISTER: You are no able to use this command at this point. Wait %d seconds."RegisterTime[playerid] - gettime());
        return 
SendClientMessage(playerid, -1Str);
    }
    
// Proceed to register the player..
    
    
return 1;