[HELp]Help With Fix /stats+ /rules
#1

Код HTML:
CMD:stats(playerid,params[])
{
    new string[428], sLine[34], pDeaths, player1, h, m, s;
    if (!strlen(params)) player1 = playerid;
    else player1 = strval(params);

    if (IsPlayerConnected(player1))
    {
        TotalGameTime(player1, h, m, s);
        if (PlayerInfo[player1][Deaths] == 0) pDeaths = 1;
        else pDeaths = PlayerInfo[player1][Deaths];

        format(sLine, sizeof(sLine), "{fff000}+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+");
        format(string, sizeof(string), "%s {FC0303}%s's Stats %s \n*Player Kills: %d \n*Player Deaths: %d \n*Player Ratio: %0.2f \n*Player Money: $%d \nSkin: %d \nScore: %d \nAdmin Level: %d \nPing: %d \nBank: $%d \nWanted Level: %d \nInterior: %d \nCountry: %s",
            sLine,
            PlayerName2(player1),
            sLine,
            PlayerInfo[player1][Kills],
            PlayerInfo[player1][Deaths],
            Float:PlayerInfo[player1][Kills]/Float:pDeaths,
            GetPlayerMoney(player1),
            GetPlayerSkin(player1),
            GetPlayerScore(player1),
            PlayerInfo[player1][Level],
            GetPlayerPing(player1),
            PlayerInfo[player1][bank],
            GetPlayerWantedLevel(player1),
            GetPlayerInterior(player1),
            GetPlayerCountryName(playerid)
        );
        return ShowPlayerDialog(playerid, 758, 0, "[YS]Player Stats", string, "Ok", "");
    }
    else SendClientMessage(playerid, red, "Player Not Connected!");
    return 1;
}
Can anybodt Help my Change This To /stast Read My self No need /stats and id




PHP код:
CMD:rules(playerid,params[])
{
    new 
string[500];
    
string "1.Do not jack other's car while they are exchanging or buying Vehicle.\n";
    
strcat(string"2.Exchange car's only with the present of server Admin . To see online admins /admins\n\
    3.Do not use bad words.\n\
    4.Do not advetise.\n\
    6.Do not use any kind of hacks.\n\
    7.You can use car mods only.\n\
    9.rules*
    10.rules
    11.rules
    12.rules
    13.rules
    14.rules
    17.rules
    18.rules
    19.Do not Spam the server Chat."
);
    
ShowPlayerDialog(playerid5DIALOG_STYLE_MSGBOX"{46BEE6}YS Server Credits:"string"I Agree""I Disagree");
    return 
1;

Iwant To Add More Line
Reply
#2

Could you be more exact please?
and use sendclientmessage, i think it's easyer for you to understand.
pawn Код:
CMD:rules(playerid,params[])
{
    SendClientMessage(playerid, -1, "1.Do not jack other's car while they are exchanging or buying Vehicle.");
    SendClientMessage(playerid, -1, "2.Exchange car's only with the present of server Admin . To see online admins /admins");
    return 1;
}
// -1 = the color (WHITE) , for more lines, just add another line like this:
// SendClientMessage(playerid, -1, "Your Text here.");
Reply
#3

The is your problems solved

Stats

pawn Код:
CMD:stats(playerid)
{
    new string[428], sLine[34], pDeaths, h, m, s;
    TotalGameTime(playerid, h, m, s);
    if (PlayerInfo[playerid][Deaths] == 0) pDeaths = 1;
    else pDeaths = PlayerInfo[playerid][Deaths];

    format(sLine, sizeof(sLine), "{fff000}+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+");
    format(string, sizeof(string), "%s {FC0303}%s's Stats %s \n*Player Kills: %d \n*Player Deaths: %d \n*Player Ratio: %0.2f \n*Player Money: $%d \nSkin: %d \nScore: %d \nAdmin Level: %d \nPing: %d \nBank: $%d \nWanted Level: %d \nInterior: %d \nCountry: %s",
        sLine,
        PlayerName2(playerid),
        sLine,
        PlayerInfo[playerid][Kills],
        PlayerInfo[playerid][Deaths],
        Float:PlayerInfo[playerid][Kills]/Float:pDeaths,
        GetPlayerMoney(playerid),
        GetPlayerSkin(playerid),
        GetPlayerScore(playerid),
        PlayerInfo[playerid][Level],
        GetPlayerPing(playerid),
        PlayerInfo[playerid][bank],
        GetPlayerWantedLevel(playerid),
        GetPlayerInterior(playerid),
        GetPlayerCountryName(playerid)
    );
    return ShowPlayerDialog(playerid, 758, 0, "[YS]Your Stats", string, "Ok", "");
}
Rules

pawn Код:
CMD:rules(playerid)
{
    new PT[1000];
    strcat(PT, "{FFFFFF}>: Rule 1   \n", sizeof(PT));
    strcat(PT, "{00FF00}>: Rule 2   \n", sizeof(PT));
    strcat(PT, "{00FF00}>: Rule 3   \n", sizeof(PT));
    strcat(PT, "{00FF00}>: Rule 4   \n", sizeof(PT));
   
    ShowPlayerDialog(playerid, 5, DIALOG_STYLE_MSGBOX, "{46BEE6}YS Server Rules:", PT, "I Agree", "I Disagree");
    return 1;
}
Reply
#4

Thanks But How The rules i make more line ?
Reply
#5

Well, I'm assuming you could just add an extra line to that.
Look at rule 20.

pawn Код:
CMD:rules(playerid,params[])
{
    new string[500];
    string = "1.Do not jack other's car while they are exchanging or buying Vehicle.\n";
    strcat(string, "2.Exchange car's only with the present of server Admin . To see online admins /admins\n\
    3.Do not use bad words.\n\
    4.Do not advertise.\n\
    6.Do not use any kind of hacks.\n\
    7.You can use car mods only.\n\
    9.rules*
    10.rules
    11.rules
    12.rules
    13.rules
    14.rules
    17.rules
    18.rules
    19.Do not Spam the server Chat.
    20.If you post codes on SA-MP server, use [ pawn ] tags."
);
    ShowPlayerDialog(playerid, 5, DIALOG_STYLE_MSGBOX, "{46BEE6}YS Server Credits:", string, "I Agree", "I Disagree");
    return 1;
}
Reply
#6

Quote:
Originally Posted by donhu789
Посмотреть сообщение
Thanks But How The rules i make more line ?
simple only copy this

pawn Код:
strcat(PT, "{FFFFFF}>: Rule ?   \n", sizeof(PT));
and put below the last rule you write, and where say rule? is on you write the rules

example

pawn Код:
CMD:rules(playerid)
{
    new PT[1000];
    strcat(PT, "{FFFFFF}>: Rule 1   \n", sizeof(PT));
    strcat(PT, "{00FF00}>: Rule 2   \n", sizeof(PT));
    strcat(PT, "{00FF00}>: Rule 3   \n", sizeof(PT));
    strcat(PT, "{00FF00}>: Rule 4   \n", sizeof(PT));
    strcat(PT, "{00FF00}>: Rule ?   \n", sizeof(PT));
    strcat(PT, "{00FF00}>: Rule ?   \n", sizeof(PT));
    strcat(PT, "{00FF00}>: Rule ?   \n", sizeof(PT));
    strcat(PT, "{00FF00}>: Rule ?   \n", sizeof(PT));
    strcat(PT, "{00FF00}>: Rule ?   \n", sizeof(PT));
    strcat(PT, "{00FF00}>: Rule ?   \n", sizeof(PT));
    // and continues
   
    ShowPlayerDialog(playerid, 5, DIALOG_STYLE_MSGBOX, "{46BEE6}YS Server Rules:", PT, "I Agree", "I Disagree");
    return 1;
}
you understand?
Reply
#7

Thanks guy but now i need help with /register and /login Zcmds with dialog


[pawn]CMD:login(playerid,params[])
{
if (PlayerInfo[playerid][LoggedIn] == 1) return SendClientMessage(playerid,COLOR_RED,"{FA0C24}ACCO UNT: You are {FAFA0C}already logged in.");
if (!udb_Exists(PlayerName2(playerid))) return SendClientMessage(playerid,COLOR_RED,"{FA0C24}ACCO UNT: Account doesn't exist, please use {FAFA0C}'/register [password]'.");
if (strlen(params)==0) return SendClientMessage(playerid,COLOR_RED,"{FA0C24}ACCO UNT: Correct usage: {FAFA0C}'/login [password]'");
if (udb_CheckLogin(PlayerName2(playerid),params))
{
new file[256], tmp3[100], string[128], lname[MAX_PLAYER_NAME];
GetPlayerName(playerid,lname,sizeof(lname));
format(file,sizeof(file),"/ladmin/users/%s.sav",udb_encode(lname));
GetPlayerIp(playerid,tmp3,100);
dini_Set(file,"ip",tmp3);
LoginPlayer(playerid);
LoadPlayer(playerid);
PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
if(PlayerInfo[playerid][Level] > 0) {
format(string,sizeof(string),"{FAFA0C}ACCOUNT: Successfully {251BE0}Logged In. {FA0C24}(Level %d)", PlayerInfo[playerid][Level] );
return SendClientMessage(playerid,green,string);
} else return SendClientMessage(playerid,green,"{FAFA0C}ACCOUNT: {251BE0}Successfully {FA0C24}Logged In");
}
return SendClientMessage(playerid,COLOR_RED,"{FAFA0C}ACCO UNT: {251BE0}Login failed! {FA0C24}Incorrect Password");
}

LoginPlayer(playerid)
{
if(ServerInfo[GiveMoney] == 1) {ResetPlayerMoney(playerid); GivePlayerMoney(playerid, dUserINT(PlayerName2(playerid)).("money") ); }
dUserSetINT(PlayerName2(playerid)).("loggedin",1);
PlayerInfo[playerid][Deaths] = (dUserINT(PlayerName2(playerid)).("deaths"));
PlayerInfo[playerid][Kills] = (dUserINT(PlayerName2(playerid)).("kills"));
PlayerInfo[playerid][Level] = (dUserINT(PlayerName2(playerid)).("level"));
PlayerInfo[playerid][Registered] = 1;
PlayerInfo[playerid][LoggedIn] = 1;
}[pawn]
Reply
#8

Quote:
Originally Posted by PT
Посмотреть сообщение
simple only copy this

pawn Код:
strcat(PT, "{FFFFFF}>: Rule ?   \n", sizeof(PT));
and put below the last rule you write, and where say rule? is on you write the rules

example

pawn Код:
CMD:rules(playerid)
{
    new PT[1000];
    strcat(PT, "{FFFFFF}>: Rule 1   \n", sizeof(PT));
    strcat(PT, "{00FF00}>: Rule 2   \n", sizeof(PT));
    strcat(PT, "{00FF00}>: Rule 3   \n", sizeof(PT));
    strcat(PT, "{00FF00}>: Rule 4   \n", sizeof(PT));
    strcat(PT, "{00FF00}>: Rule ?   \n", sizeof(PT));
    strcat(PT, "{00FF00}>: Rule ?   \n", sizeof(PT));
    strcat(PT, "{00FF00}>: Rule ?   \n", sizeof(PT));
    strcat(PT, "{00FF00}>: Rule ?   \n", sizeof(PT));
    strcat(PT, "{00FF00}>: Rule ?   \n", sizeof(PT));
    strcat(PT, "{00FF00}>: Rule ?   \n", sizeof(PT));
    // and continues
   
    ShowPlayerDialog(playerid, 5, DIALOG_STYLE_MSGBOX, "{46BEE6}YS Server Rules:", PT, "I Agree", "I Disagree");
    return 1;
}
you understand?
Yes im understand But i need help with /register and login commands in dialog ( becuz is too hard
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)