Repair command with money
#6

PHP код:
CMD:login(playerid,params[])
{
    print(
"Code pos #6");
    new 
file[256],n[MAX_PLAYER_NAME];
    
GetPlayerName(playerid,n,MAX_PLAYER_NAME);
    
format(file,sizeof(file),"gAdmin/Users/%s.txt",n);
       if(!
dini_Exists(file)) return SendClientMessage(playerid,COLOR_YELLOW,"You are not registered! Please /register");
    if(
PInfo[playerid][Logged] == 1) return SendClientMessage(playerid,COLOR_LIGHTBLUE,"You are already logged in!");
    if(
PInfo[playerid][Regged] == 0) return SendClientMessage(playerid,COLOR_ORANGE,"You are not registered! Please /register");
    if(
strlen(params))
    {
        if(
dini_Exists(file))
        {
            print(
"Code pos #7");
            if(
strcmp(params,dini_Get(file,"Password"),false) != 0)
            {
                
SendClientMessage(playerid,COLOR_YELLOW,"Wrong Password!");
            }
            else
            {
                
dini_IntSet(file,"Logged",1);
                
PInfo[playerid][Logged] = 1;
                
PInfo[playerid][Level] = dini_Int(file,"Level");
                
PInfo[playerid][Team] = dini_Int(file"Team");
                
PInfo[playerid][Money] = dini_Int(file,"Money");
                
ResetPlayerMoney(playerid);
                
GivePlayerMoney(playeridPInfo[playerid][Money]);
                
SendClientMessage(playerid,COLOR_YELLOW,"You have now logged in!");
                return 
1;
            }
        }
    }
    else
    {
        
SendClientMessage(playerid,COLOR_GREY,"USAGE: /login <Password>");
        return 
1;
    }
    return 
1;

Reply


Messages In This Thread
Repair command with money - by luckie12 - 30.03.2016, 12:16
Re: Repair command with money - by Mencent - 30.03.2016, 12:19
Re: Repair command with money - by luckie12 - 30.03.2016, 12:27
Re: Repair command with money - by theonethatownz - 30.03.2016, 13:01
Re: Repair command with money - by luckie12 - 30.03.2016, 13:27
Re: Repair command with money - by Mencent - 30.03.2016, 13:28
Re: Repair command with money - by luckie12 - 30.03.2016, 13:48
Re: Repair command with money - by Mencent - 30.03.2016, 13:50
Re: Repair command with money - by luckie12 - 30.03.2016, 13:51
Re: Repair command with money - by Mencent - 30.03.2016, 13:52

Forum Jump:


Users browsing this thread: 2 Guest(s)