How To Make This? - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: How To Make This? (
/showthread.php?tid=238235)
How To Make This? -
Roomeo - 11.03.2011
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;
}
Re: How To Make This? -
Riddick94 - 11.03.2011
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");
Re: How To Make This? -
Roomeo - 11.03.2011
Can You Post Full Scrpt here i don't understand
Re: How To Make This? -
Riddick94 - 11.03.2011
https://sampwiki.blast.hk/wiki/Format
Re: How To Make This? -
Roomeo - 11.03.2011
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.
Re: How To Make This? -
HyperZ - 11.03.2011
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");
}
Re: How To Make This? -
Roomeo - 11.03.2011
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);
}
}
}
}
Re: How To Make This? -
xir - 11.03.2011
Add an ";"
Re: How To Make This? -
Roomeo - 11.03.2011
Still this Error (i had Tried This )
Re: How To Make This? -
HyperZ - 11.03.2011
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);
}
}
}
}