SA-MP Forums Archive
Can Anyone Help[+REP] - 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: Can Anyone Help[+REP] (/showthread.php?tid=528788)



Can Anyone Help[+REP] - Iloveimpulse - 29.07.2014


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


Re: Can Anyone Help[+REP] - SickAttack - 29.07.2014

"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


Re: Can Anyone Help - youssefehab500 - 29.07.2014

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


Re: Can Anyone Help[+REP] - Iloveimpulse - 30.07.2014

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.



Re: Can Anyone Help[+REP] - Sawalha - 30.07.2014

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


Re: Can Anyone Help[+REP] - Iloveimpulse - 30.07.2014

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.



Re: Can Anyone Help[+REP] - Iloveimpulse - 30.07.2014

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


Re: Can Anyone Help[+REP] - SickAttack - 30.07.2014

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.


Re: Can Anyone Help[+REP] - Iloveimpulse - 30.07.2014

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?


Re: Can Anyone Help[+REP] - SickAttack - 30.07.2014

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);