Can Anyone Help[+REP]
#1

  • How to show ID like Deadly[6]

Like Above^^^
How to add that when player connects like this one and when he disconnects also if he dies show a death icon
Also How to make a Welcome Dialog after Players Login. Im using LuXadmin
Reply
#2

"How to show ID like Deadly[6]"
pawn Код:
format(string, sizeof(string), "%s[%d]", PlayerName(playerid), playerid);

stock PlayerName(playerid)
{
    new pname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, pname, sizeof(pname));
    return pname;
}
"How to add that when player connects like this one and when he disconnects"
pawn Код:
public OnPlayerConnect(playerid)
{
    new string[144];
    format(string, sizeof(string), "* %s[%d] has joined the server!", PlayerName(playerid), playerid);
    SendClientMessageToAll(0xFFFFFFFF, string)
    return 1;
}

public OnPlayerDisconnect(playerid)
{
    new string[144];
    format(string, sizeof(string), "* %s[%d] has left the server!", PlayerName(playerid), playerid);
    SendClientMessageToAll(0xFFFFFFFF, string)
    return 1;
}
"also if he dies show a death icon"
https://sampwiki.blast.hk/wiki/SendDeathMessage

"Also How to make a Welcome Dialog after Players Login"
https://sampwiki.blast.hk/wiki/ShowPlayerDialog
https://sampforum.blast.hk/showthread.php?tid=379247
Reply
#3

Quote:
Originally Posted by Iloveimpulse
Посмотреть сообщение
  • How to show ID like Deadly[6]
How to add that when player connects like this one and when he disconnects also if he dies show a death icon
Also How to make a Welcome Dialog after Players Login. Im using LuXadmin
For The id go under OnPlayerText:
PHP код:
if(IsPlayerConnected(playerid))
{
    new 
idMSG[150];
    
format(idMSG,sizeof(idMSG),"%s [%d]: {FFFFFF}%s"PlayerName(playerid), playeridtext);
    
SendClientMessageToAll(GetPlayerColor(playerid), idMSG);
    return 
1;

For The Death Window: under OnPlayerDisconnect:
PHP код:
SendDeathMessage(INVALID_PLAYER_IDplayerid,201); 
Under OnPlayerConnect:
PHP код:
SendDeathMessage(INVALID_PLAYER_IDplayerid200); 
and for the dialog goto OnPlayerConnect:
PHP код:
ShowPlayerDialog(playerid,DIALOG_STYLE_MSGBOX,"Your Server Name","Welcome To Your server's name, And Enjoy Your Stay"); 
and rep+ me if u like them
Im Always Slow
Reply
#4

Quote:
Originally Posted by SickAttack
Посмотреть сообщение
"How to show ID like Deadly[6]"
pawn Код:
format(string, sizeof(string), "%s[%d]", PlayerName(playerid), playerid);

stock PlayerName(playerid)
{
    new pname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, pname, sizeof(pname));
    return pname;
}
"How to add that when player connects like this one and when he disconnects"
pawn Код:
public OnPlayerConnect(playerid)
{
    new string[144];
    format(string, sizeof(string), "* %s[%d] has joined the server!", PlayerName(playerid), playerid);
    SendClientMessageToAll(0xFFFFFFFF, string)
    return 1;
}

public OnPlayerDisconnect(playerid)
{
    new string[144];
    format(string, sizeof(string), "* %s[%d] has left the server!", PlayerName(playerid), playerid);
    SendClientMessageToAll(0xFFFFFFFF, string)
    return 1;
}
"also if he dies show a death icon"
https://sampwiki.blast.hk/wiki/SendDeathMessage

"Also How to make a Welcome Dialog after Players Login"
https://sampwiki.blast.hk/wiki/ShowPlayerDialog
https://sampforum.blast.hk/showthread.php?tid=379247
For the Deadly[6] thing i got thing error
Код:
F:\Server\gamemodes\Impulse1.pwn(21) : error 021: symbol already defined: "format"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Reply
#5

iloveimpulse, Add the "format" code inside a function, not out of function
Reply
#6

Quote:
Originally Posted by Sawalha
Посмотреть сообщение
iloveimpulse, Add the "format" code inside a function, not out of function
i added this OnPlayerText:
I get this
Код:
F:\Server\gamemodes\Impulse1.pwn(310) : error 017: undefined symbol "string"
F:\Server\gamemodes\Impulse1.pwn(310) : error 017: undefined symbol "string"
F:\Server\gamemodes\Impulse1.pwn(310) : error 029: invalid expression, assumed zero
F:\Server\gamemodes\Impulse1.pwn(310) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Reply
#7

Quote:
Originally Posted by Sawalha
Посмотреть сообщение
iloveimpulse, Add the "format" code inside a function, not out of function
Where Function? do you mean onplayercommandtext?
Reply
#8

Quote:
Originally Posted by Iloveimpulse
Посмотреть сообщение
For the Deadly[6] thing i got thing error
Код:
F:\Server\gamemodes\Impulse1.pwn(21) : error 021: symbol already defined: "format"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
"format(string, sizeof(string), "%s[%d]", PlayerName(playerid), playerid);"

^ It is only an example, it is not a part of the code.
Reply
#9

Quote:
Originally Posted by SickAttack
Посмотреть сообщение
"format(string, sizeof(string), "%s[%d]", PlayerName(playerid), playerid);"

^ It is only an example, it isn't a part of the code.
So if i dont add it there is no problem?
Reply
#10

Quote:
Originally Posted by Iloveimpulse
Посмотреть сообщение
So if i dont add it there is no problem?
Exactly.

Here's that death message you wanted (Put it under OnPlayerConnect):
pawn Код:
SendDeathMessage(INVALID_PLAYER_ID, playerid, 200);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)