SA-MP Forums Archive
[ZCMD]Help With Warning Whent Player Login Fail to server - 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: [ZCMD]Help With Warning Whent Player Login Fail to server (/showthread.php?tid=465434)



[ZCMD]Help With Warning Whent Player Login Fail to server - donhu789 - 22.09.2013

I Want To Make the Thing Whent Player login failed

I already Have Dialog


Can Anyone Help ?


Re: [ZCMD]Help With Warning Whent Player Login Fail to server - DanishHaq - 22.09.2013

What do you want? A dialog instead of the text?

If so, use strcat:

pawn Код:
new dialogstring[100], string[600]; // don't have time to count them
format(dialogstring, sizeof(dialogstring), "LINE 1", values);
strcat(dialogstring, string);
format(dialogstring, sizeof(dialogstring), "LINE 2", values);
strcat(dialogstring, string);
format(dialogstring, sizeof(dialogstring), "LINE 3", values);
strcat(dialogstring, string);
format(dialogstring, sizeof(dialogstring), "LINE 4", values);
strcat(dialogstring, string);
format(dialogstring, sizeof(dialogstring), "LINE 5", values);
strcat(dialogstring, string);
format(dialogstring, sizeof(dialogstring), "LINE 6", values);
strcat(dialogstring, string);
ShowPlayerDIalog(playerid, 1595, DIALOG_STYLE_MSGBOX, "Information", string, "Ok", "");



Re: [ZCMD]Help With Warning Whent Player Login Fail to server - donhu789 - 22.09.2013

-_- I want To Make That Thing in pic Becuz i tryed Alot Of Time is didnt show


Re: [ZCMD]Help With Warning Whent Player Login Fail to server - DanishHaq - 22.09.2013

Quote:
Originally Posted by donhu789
Посмотреть сообщение
-_- I want To Make That Thing in pic Becuz i tryed Alot Of Time is didnt show
Show us what you've done then, codewise. Next time, explain it so it makes more sense, like "I want to make my server look like this when someone gets kicked / banned". Not "I Want To Make the Thing Whent Player login failed", what's the "thing"? You see.. that's how people get confused. Anyhow, show the code for what you've done already.


Re: [ZCMD]Help With Warning Whent Player Login Fail to server - donhu789 - 22.09.2013

Your Failed Login Thinging See ?
I want to add that :\


Re: [ZCMD]Help With Warning Whent Player Login Fail to server - donhu789 - 22.09.2013

Nah Never Mind It I done it But can you make My a Givemoney commands I accidently Detele :\


And I need to Add MOre Line In THis thing but How ?

PHP код:
CMD:stats(playerid,params[])
{
    new 
pDeathsplayer1hms,playername[MAX_PLAYER_NAME];
    if(
isnull(params)) player1 playerid;
    else 
player1 strval(params);
    if(
IsPlayerConnected(player1)) {
        
TotalGameTime(player1hms);
        
GetPlayerName(player1playernamesizeof(playername));
        if(
PlayerInfo[player1][Deaths] == 0pDeaths 1; else pDeaths PlayerInfo[player1][Deaths];
        new 
str[20][1000];
        
format(str[0],1000,"| ------ |COD Stats For  %s's | ------- |\n"PlayerName2(player1));
        
strcat(str[1],str[0]);
        
format(str[2],1000,"Scores: %d | Money: $%d | Kills: %d | Deaths: %d | K/D Ratio: %0.2f\n"GetPlayerScore(player1), GetPlayerMoney(player1), PlayerInfo[player1][Kills], PlayerInfo[player1][Deaths], Float:PlayerInfo[player1][Kills]/Float:pDeaths);
        
strcat(str[1],str[2]);
        
format(str[3],1000,"Admin Level: %d | Moderator: %s | Rank: %s | Team: %s | Class: %s | Skin: %d\n"PlayerInfo[player1][Level], PlayerInfo[player1][Helper] ? ("Yes") : ("No"), GetRankName(player1), GetTeamName(player1), GetClass(player1), GetPlayerSkin(player1));
        
strcat(str[1],str[3]);
        
format(str[4],1000,"TimePlayed: [%d] hrs [%d] mins [%d] secs\n"hms);
        
strcat(str[1],str[4]);
        
format(str[5],1000,"| ---------------------------------------------------- |");
        
strcat(str[1],str[5]);
        
ShowPlayerDialog(playerid,DIALOG_STATS,DIALOG_STYLE_MSGBOX,"Player Stats",str[1],"OK","");
    } else return 
SendClientMessage(playeridred"Player Not Connected!");
    return 
1;

help ? = REp REP REP REP REP realy REP


Re: [ZCMD]Help With Warning Whent Player Login Fail to server - DanishHaq - 22.09.2013

Quote:
Originally Posted by donhu789
Посмотреть сообщение
Your Failed Login Thinging See ?
I want to add that :\
How is your player being logged in? Show us that code too.

Quote:
Originally Posted by donhu789
Посмотреть сообщение
Nah Never Mind It I done it But can you make My a Givemoney commands I accidently Detele :\


And I need to Add MOre Line In THis thing but How ?

PHP код:
CMD:stats(playerid,params[])
{
    new 
pDeathsplayer1hms,playername[MAX_PLAYER_NAME];
    if(
isnull(params)) player1 playerid;
    else 
player1 strval(params);
    if(
IsPlayerConnected(player1)) {
        
TotalGameTime(player1hms);
        
GetPlayerName(player1playernamesizeof(playername));
        if(
PlayerInfo[player1][Deaths] == 0pDeaths 1; else pDeaths PlayerInfo[player1][Deaths];
        new 
str[20][1000];
        
format(str[0],1000,"| ------ |COD Stats For  %s's | ------- |\n"PlayerName2(player1));
        
strcat(str[1],str[0]);
        
format(str[2],1000,"Scores: %d | Money: $%d | Kills: %d | Deaths: %d | K/D Ratio: %0.2f\n"GetPlayerScore(player1), GetPlayerMoney(player1), PlayerInfo[player1][Kills], PlayerInfo[player1][Deaths], Float:PlayerInfo[player1][Kills]/Float:pDeaths);
        
strcat(str[1],str[2]);
        
format(str[3],1000,"Admin Level: %d | Moderator: %s | Rank: %s | Team: %s | Class: %s | Skin: %d\n"PlayerInfo[player1][Level], PlayerInfo[player1][Helper] ? ("Yes") : ("No"), GetRankName(player1), GetTeamName(player1), GetClass(player1), GetPlayerSkin(player1));
        
strcat(str[1],str[3]);
        
format(str[4],1000,"TimePlayed: [%d] hrs [%d] mins [%d] secs\n"hms);
        
strcat(str[1],str[4]);
        
format(str[5],1000,"| ---------------------------------------------------- |");
        
strcat(str[1],str[5]);
        
ShowPlayerDialog(playerid,DIALOG_STATS,DIALOG_STYLE_MSGBOX,"Player Stats",str[1],"OK","");
    } else return 
SendClientMessage(playeridred"Player Not Connected!");
    return 
1;

help ? = REp REP REP REP REP realy REP
For the /stats, just copy and paste one of the format's and the strcat, and then paste it under one of the strcat's where you want to add something, and then simple add it. And make your own /givemoney command, that ain't hard either.


Re: [ZCMD]Help With Warning Whent Player Login Fail to server - donhu789 - 22.09.2013

you want this ??

PHP код:
public OnPlayerConnect(playerid)
{
    if (
udb_Exists(PlayerName2(playerid)))
    {
      if(
PlayerInfo[playerid][LoggedIn] == 0)
      {
          new 
string[500];
          
format(stringsizeof(string),""cwhite"Welcome Back"cred"%s "cwhite" To Call Of Duty Wolrd At War\nYour Account Is Already Registered!\nEnter Your Password Below To Load Your Status\n(Score,Cash,rank,Kills,etc)"PlayerName2(playerid));
          
ShowPlayerDialog(playerid125DIALOG_STYLE_PASSWORD"Login Account",string,"Login","Kick");
      }
    }
    if (!
udb_Exists(PlayerName2(playerid)))
    {
      if(
PlayerInfo[playerid][Registered] == 0)
      {
          new 
string[200];
          
format(stringsizeof(string),""cwhite"Welcome "cred"%s "cwhite"To Call Of Duty Wolrd At War\nYour Account is not Registered!\nEnter your Password Below To Save Your Status\n(Score,Cash,Ranks,Kill,etc)"PlayerName2(playerid));
          
ShowPlayerDialog(playerid126DIALOG_STYLE_PASSWORD"Register Account",string,"Register","Kick");
      }
    }
    if(
PlayerInfo[playerid][LoggedIn] == 1)
    {
        new 
pname[128];
        new 
file[128];
        
GetPlayerName(playeridpnamesizeof(pname));
        
format(filesizeof(file), savefolder,pname);
        if(!
dini_Exists(file))
        {
            
dini_Create(file);
            
dini_IntSet(file"Score"0);
            
dini_IntSet(file"Money"0);
            
SetPlayerScore(playeriddini_Int(file"Score"));
            
SetPlayerMoney(playeriddini_Int(file"Money"));
        }
        else
        {
            
SetPlayerScore(playeriddini_Int(file"Score"));
            
SetPlayerMoney(playeriddini_Int(file"Money"));
        }
    } 



Re: [ZCMD]Help With Warning Whent Player Login Fail to server - DanishHaq - 22.09.2013

Quote:
Originally Posted by donhu789
Посмотреть сообщение
you want this ??

PHP код:
public OnPlayerConnect(playerid)
{
    if (
udb_Exists(PlayerName2(playerid)))
    {
      if(
PlayerInfo[playerid][LoggedIn] == 0)
      {
          new 
string[500];
          
format(stringsizeof(string),""cwhite"Welcome Back"cred"%s "cwhite" To Call Of Duty Wolrd At War\nYour Account Is Already Registered!\nEnter Your Password Below To Load Your Status\n(Score,Cash,rank,Kills,etc)"PlayerName2(playerid));
          
ShowPlayerDialog(playerid125DIALOG_STYLE_PASSWORD"Login Account",string,"Login","Kick");
      }
    }
    if (!
udb_Exists(PlayerName2(playerid)))
    {
      if(
PlayerInfo[playerid][Registered] == 0)
      {
          new 
string[200];
          
format(stringsizeof(string),""cwhite"Welcome "cred"%s "cwhite"To Call Of Duty Wolrd At War\nYour Account is not Registered!\nEnter your Password Below To Save Your Status\n(Score,Cash,Ranks,Kill,etc)"PlayerName2(playerid));
          
ShowPlayerDialog(playerid126DIALOG_STYLE_PASSWORD"Register Account",string,"Register","Kick");
      }
    }
    if(
PlayerInfo[playerid][LoggedIn] == 1)
    {
        new 
pname[128];
        new 
file[128];
        
GetPlayerName(playeridpnamesizeof(pname));
        
format(filesizeof(file), savefolder,pname);
        if(!
dini_Exists(file))
        {
            
dini_Create(file);
            
dini_IntSet(file"Score"0);
            
dini_IntSet(file"Money"0);
            
SetPlayerScore(playeriddini_Int(file"Score"));
            
SetPlayerMoney(playeriddini_Int(file"Money"));
        }
        else
        {
            
SetPlayerScore(playeriddini_Int(file"Score"));
            
SetPlayerMoney(playeriddini_Int(file"Money"));
        }
    } 
Ok, and what's your OnDialogResponse for the login dialog?


Re: [ZCMD]Help With Warning Whent Player Login Fail to server - donhu789 - 22.09.2013

Nothnig :\ that my problem :\