How To Make This?
#1

Hello I've Maded this Dialog System Now i want it says Welcome Back (Here player Name)
And when it ask's for the pass (when logging and the pass is wrong it give three attempts to login)
i've just done this
pawn Код:
new name[MAX_PLAYER_NAME], dat[200];
    GetPlayerName(playerid, name, sizeof(name));
    format(dat, sizeof(dat), "MyData/User/%s.txt", name);
    if(!fexist(dat))
    {
        ShowPlayerDialog(playerid, 0, DIALOG_STYLE_INPUT, "Registration", "You Are New On This Server!\nPlease Enter Your Password Below To Regiser\n An Account.", "Continue", "Quit");
    }else{                          
        ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT, "Login", "Welcome Back %s.\nBefore you can start playing, we ask you\nto login.", "Continue", "Quit");
    }
    return 1;
}
Reply
#2

You need to format ShowPlayerDialog.

pawn Код:
format(string, sizeof(string), "Welcome Back %s.\nBefore you can start playing, we ask you\nto login.", FunctionGetPlayerName);
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT, "Register", string, "Continue", "Quit");
Reply
#3

Can You Post Full Scrpt here i don't understand
Reply
#4

https://sampwiki.blast.hk/wiki/Format
Reply
#5

this Huh?
pawn Код:
new name[MAX_PLAYER_NAME], dat[200];
    GetPlayerName(playerid, name, sizeof(name));
    format(dat, sizeof(dat), "MyData/User/%s.txt", name);
    if(!fexist(dat))
    {
     format(string, sizeof(string), "Welcome Back %s.\nBefore you can start playing, we ask you\nto login.", FunctionGetPlayerName);

    }else{                          
        ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT, "Register", string, "Continue", "Quit");
    }
    return 1;
}
pawn Код:
I:\Games\RockStar Game Gta San Andreas\Gta Sanandreas\My Script\gamemodes\MyScript.pwn(824) : error 017: undefined symbol "string"
I:\Games\RockStar Game Gta San Andreas\Gta Sanandreas\My Script\gamemodes\MyScript.pwn(824) : error 017: undefined symbol "string"
I:\Games\RockStar Game Gta San Andreas\Gta Sanandreas\My Script\gamemodes\MyScript.pwn(824) : error 029: invalid expression, assumed zero
I:\Games\RockStar Game Gta San Andreas\Gta Sanandreas\My Script\gamemodes\MyScript.pwn(824) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.
Reply
#6

pawn Код:
new name[MAX_PLAYER_NAME], dat[200], string[128];
GetPlayerName(playerid, name, sizeof(name));
format(dat, sizeof(dat), "MyData/User/%s.txt", name);
if(!fexist(dat))
{
    ShowPlayerDialog(playerid, 0, DIALOG_STYLE_INPUT, "Registration", "You Are New On This Server!\nPlease Enter Your Password Below To Regiser\n An Account.", "Continue", "Quit");
}
else
{
    format(string, sizeof(string), "Welcome Back %s.\nBefore you can start playing, we ask you\nto login.", name);
    ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT, "Login", string, "Continue", "Quit");
}
Reply
#7

This Is Fixed Now
pawn Код:
I:\Games\RockStar Game Gta San Andreas\Gta Sanandreas\My Script\gamemodes\MyScript.pwn(833) : error 017: undefined symbol "MoneyTimerForward"
I:\Games\RockStar Game Gta San Andreas\Gta Sanandreas\My Script\gamemodes\MyScript.pwn(835) : error 001: expected token: ";", but found "public"
I:\Games\RockStar Game Gta San Andreas\Gta Sanandreas\My Script\gamemodes\MyScript.pwn(835) : error 029: invalid expression, assumed zero
I:\Games\RockStar Game Gta San Andreas\Gta Sanandreas\My Script\gamemodes\MyScript.pwn(835) : error 017: undefined symbol "MoneyTimer"
I:\Games\RockStar Game Gta San Andreas\Gta Sanandreas\My Script\gamemodes\MyScript.pwn(835) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


5 Errors.
Script
pawn Код:
MoneyTimerForward()

public MoneyTimer()
{
    new username[MAX_PLAYER_NAME];
    for(new i=0; i<MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            if(GetPlayerCash(i) != GetPlayerMoney(i))
            {
                ResetMoneyBar(i);
                UpdateMoneyBar(i,GetPlayerCash(i));
                new hack = GetPlayerMoney(i) - GetPlayerCash(i);
                GetPlayerName(i,username,sizeof(username));
                printf("%s has picked up/attempted to spawn $%d.", username,hack);
            }
        }
    }
}
Reply
#8

pawn Код:
MoneyTimerForward();
Add an ";"
Reply
#9

Still this Error (i had Tried This )
Reply
#10

pawn Код:
forward MoneyTimer();
public MoneyTimer()
{
    new username[MAX_PLAYER_NAME];
    for(new i=0; i<MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            if(GetPlayerCash(i) != GetPlayerMoney(i))
            {
                ResetMoneyBar(i);
                UpdateMoneyBar(i,GetPlayerCash(i));
                new hack = GetPlayerMoney(i) - GetPlayerCash(i);
                GetPlayerName(i,username,sizeof(username));
                printf("%s has picked up/attempted to spawn $%d.", username,hack);
            }
        }
    }
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)