/duty help (+rep)
#1

Alright, i want it to announce that the rank of the player and their name is now on duty when they go on duty,
so like



Also can someone tell me what color define this is,

Reply
#2

Код:
#include <zcmd> // Incase you don't use it

CMD:onduty(playerid, params[])
{
	new name[MAX_PLAYER_NAME], str[256];
	GetPlayerName(playerid, name, sizeof(name));
	format(str, sizeof(str), "%s is now On Duty!", name);
	SendClientMessageToAll(0x0099CC, str);
	return 1;
}
About the colors you can ****** it.
Here are some links:
1. https://sampwiki.blast.hk/wiki/Hex_colours
2. http://www.nthelp.com/colorcodes.htm
Reply
#3

how to do you define name of player and his family/faction rank pls post here
Reply
#4

Quote:
Originally Posted by UnDetectable
Посмотреть сообщение
Код:
#include <zcmd> // Incase you don't use it

CMD:onduty(playerid, params[])
{
	new name[MAX_PLAYER_NAME], str[256];
	GetPlayerName(playerid, name, sizeof(name));
	format(str, sizeof(str), "%s is now On Duty!", name);
	SendClientMessageToAll(0x0099CC, str);
	return 1;
}
About the colors you can ****** it.
Here are some links:
1. https://sampwiki.blast.hk/wiki/Hex_colours
2. http://www.nthelp.com/colorcodes.htm
I dont believe that is sending a faction message to LSPD, and i need it to say ranknames too which are these

Код:
              switch(PlayerInfo[playerid][pRank])
            {
            	case 1: format(string, sizeof(string), "**  POI %s: %s  **", sendername, text);
             	case 2: format(string, sizeof(string), "**  POII %s: %s  **", sendername, text);
                case 3: format(string, sizeof(string), "**  POIII %s: %s  **", sendername, text);
                case 4: format(string, sizeof(string), "**  POIII+1 %s: %s  **", sendername, text);
                case 5: format(string, sizeof(string), "**  Det I %s: %s  **", sendername, text);
                case 6: format(string, sizeof(string), "**  Det II %s: %s  **", sendername, text);
                case 7: format(string, sizeof(string), "**  Det III %s: %s  **", sendername, text);
                case 8: format(string, sizeof(string), "**  Sgt I %s: %s  **", sendername, text);
                case 9: format(string, sizeof(string), "**  Sgt II %s: %s  **", sendername, text);
                case 10: format(string, sizeof(string), "**  Lt I %s: %s  **", sendername, text);
                case 11: format(string, sizeof(string), "**  Lt II %s: %s  **", sendername, text);
                case 12: format(string, sizeof(string), "**  Cpt I %s: %s  **", sendername, text);
                case 13: format(string, sizeof(string), "**  Cpt II %s: %s  **", sendername, text);
                case 14: format(string, sizeof(string), "**  Cmdr %s: %s  **", sendername, text);
                case 15: format(string, sizeof(string), "**  DCoP %s: %s  **", sendername, text);
                case 16: format(string, sizeof(string), "**  ACoP %s: %s  **", sendername, text);
                case 17: format(string, sizeof(string), "**  CoP %s: %s  **", sendername, text);
Reply
#5

try this:
Код:
// at the top of your script, we are going to create a stock to get the rank name (Personally, I use this)
stock RankName(playerid)
{
    new Rank[100];
    if(PlayerInfo[playerid][pRank] == 1) Rank = "POI";
    if(PlayerInfo[playerid][pRank] == 2) Rank = "POII";
    if(PlayerInfo[playerid][pRank] == 3) Rank = "POIII";
    if(PlayerInfo[playerid][pRank] == 4) Rank = "POIII+1";
    if(PlayerInfo[playerid][pRank] == 5) Rank = "Det I";
    if(PlayerInfo[playerid][pRank] == 6) Rank = "Det II";
    if(PlayerInfo[playerid][pRank] == 7) Rank = "Det III";
    if(PlayerInfo[playerid][pRank] == 8) Rank = "Sgt I";
    if(PlayerInfo[playerid][pRank] == 9) Rank = "Sgt II";
    if(PlayerInfo[playerid][pRank] == 10) Rank = "Lt I";
    if(PlayerInfo[playerid][pRank] == 11) Rank = "Lt II";
    if(PlayerInfo[playerid][pRank] == 12) Rank = "Cpt I";
    if(PlayerInfo[playerid][pRank] == 13) Rank = "Cpt II";
    if(PlayerInfo[playerid][pRank] == 14) Rank = "Cmdr";
    if(PlayerInfo[playerid][pRank] == 15) Rank = "DCoP";
    if(PlayerInfo[playerid][pRank] == 16) Rank = "ACoP";
    if(PlayerInfo[playerid][pRank] == 17) Rank = "CoP";
    return Rank;
}

CMD:onduty(playerid, params[])
{
	new name[MAX_PLAYER_NAME], str[256];
	GetPlayerName(playerid, name, sizeof(name));
	format(str, sizeof(str), "%s %s is now On Duty!",  RankName(playerid), name);
	for(new i; i < MAX_PLAYERS; i++)
        {
            if(PlayerInfo[i][pRank] > 1) 
            {
                 SendClientMessage(i, 0x0099CC, str);
            }
        }
	return 1;
}
Just edit it to work with your script
Reply
#6

Код:
E:\Download (1)\samp03z_svr_R1_win32\pawno\ranksystem.pwn(25) : warning 203: symbol is never used: "onduty"
E:\Download (1)\samp03z_svr_R1_win32\pawno\ranksystem.pwn(25 -- 39) : error 013: no entry point (no public functions)
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)