Trying to make a /Showbadge
#1

Alright so im trying to make a /showbadge for a faction. I am trying to make it so the line directly below shows the persons name who /showbadge [Then a Playerid].

Код:
        SendClientMessageEx(giveplayerid, COLOR_GRAD2, "Agent %s is a duly sworn member of the FBI.", GetPlayerNameEx(playerid), playerid);
Код:
CMD:showbadge(playerid, params[])
{
	if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1)
	{
	SendClientMessageEx(giveplayerid, COLOR_GRAD2, "----------------------------------------------------------------------------------------------------");
        SendClientMessageEx(giveplayerid, COLOR_GRAD2, "Agent %s is a duly sworn member of the FBI.", GetPlayerNameEx(playerid), playerid);
	SendClientMessageEx(giveplayerid, COLOR_WHITE, "Current Assignment: General Duties");
	SendClientMessageEx(giveplayerid, COLOR_WHITE, "Under the Authority of the United States Government.");
	SendClientMessageEx(giveplayerid, COLOR_WHITE, "Official has the authority to arrest.");
	SendClientMessageEx(giveplayerid, COLOR_GRAD2, "----------------------------------------------------------------------------------------------------");
	return 1;
}
Reply
#2

Ok, just a couple of minutes, I'll get this done for you.
Reply
#3

Alright, use this!
pawn Код:
CMD:showbadge(playerid, params[])
{
    new giveplayerid,string[128],string2[128];
    if(sscanf(params, "u", giveplayerid)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /ShowBadge [Player Id]");
    if(PlayerInfo[playerid][pMember]== 1 || PlayerInfo[playerid][pLeader] == 1)
    {
        if(IsPlayerConnected(giveplayerid))
        {
            SendClientMessageEx(giveplayerid, COLOR_GRAD2, "----------------------------------------------------------------------------------------------------");
            format(string, sizeof(string), "Agent %s is a duly sworn member of the FBI.", GetPlayerNameEx(playerid));
            SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
            SendClientMessageEx(giveplayerid, COLOR_WHITE, "Current Assignment: General Duties");
            SendClientMessageEx(giveplayerid, COLOR_WHITE, "Under the Authority of the United States Government.");
            SendClientMessageEx(giveplayerid, COLOR_WHITE, "Official has the authority to arrest.");
            SendClientMessageEx(giveplayerid, COLOR_GRAD2, "----------------------------------------------------------------------------------------------------");
            format(string, sizeof(string), "You have shown your badge to %s!", GetPlayerNameEx(giveplayerid))
            SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string2);
        }
        else
        {
            SendClientMessageEx(playerid, COLOR_GREY, "Invalid ID!");
        }
    }
    else
    {
        SendClientMessageEx(playerid, COLOR_GREY, "You do not have a Badge!");
    }
    return 1;
}
Reply
#4

Quote:
Originally Posted by Dubya
Посмотреть сообщение
Alright, use this!
pawn Код:
CMD:showbadge(playerid, params[])
{
    new giveplayerid,string[128],string2[128];
    if(sscanf(params, "u", giveplayerid)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /ShowBadge [Player Id]");
    if(PlayerInfo[playerid][pMember]== 1 || PlayerInfo[playerid][pLeader] == 1)
    {
        if(IsPlayerConnected(giveplayerid))
        {
            SendClientMessageEx(giveplayerid, COLOR_GRAD2, "----------------------------------------------------------------------------------------------------");
            format(string, sizeof(string), "Agent %s is a duly sworn member of the FBI.", GetPlayerNameEx(playerid));
            SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
            SendClientMessageEx(giveplayerid, COLOR_WHITE, "Current Assignment: General Duties");
            SendClientMessageEx(giveplayerid, COLOR_WHITE, "Under the Authority of the United States Government.");
            SendClientMessageEx(giveplayerid, COLOR_WHITE, "Official has the authority to arrest.");
            SendClientMessageEx(giveplayerid, COLOR_GRAD2, "----------------------------------------------------------------------------------------------------");
            format(string, sizeof(string), "You have shown your badge to %s!", GetPlayerNameEx(giveplayerid))
            SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string2);
        }
        else
        {
            SendClientMessageEx(playerid, COLOR_GREY, "Invalid ID!");
        }
    }
    else
    {
        SendClientMessageEx(playerid, COLOR_GREY, "You do not have a Badge!");
    }
    return 1;
}
Thanks Bro Rec+
Reply
#5

Anytime man.. Pm me if you need any more help.
Oh, and wats your Server IP?
Reply
#6

Wait! Error hmm

Код:
C:\Users\Human\Desktop\Fusion Gaming\[Windows] SAMP\gamemodes\GMRP.pwn(1230) : error 001: expected token: ";", but found "-identifier-"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Reply
#7

pawn Код:
CMD:showbadge(playerid, params[])
{
    new giveplayerid,string[128],string2[128];
    if(sscanf(params, "u", giveplayerid)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /ShowBadge [Player Id]");
    if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1)
    {
        if(IsPlayerConnected(giveplayerid))
        {
            SendClientMessageEx(giveplayerid, COLOR_GRAD2, "----------------------------------------------------------------------------------------------------");
            format(string, sizeof(string), "Agent %s is a duly sworn member of the FBI.", GetPlayerNameEx(playerid));
            SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
            SendClientMessageEx(giveplayerid, COLOR_WHITE, "Current Assignment: General Duties");
            SendClientMessageEx(giveplayerid, COLOR_WHITE, "Under the Authority of the United States Government.");
            SendClientMessageEx(giveplayerid, COLOR_WHITE, "Official has the authority to arrest.");
            SendClientMessageEx(giveplayerid, COLOR_GRAD2, "----------------------------------------------------------------------------------------------------");
            format(string, sizeof(string), "You have shown your badge to %s!", GetPlayerNameEx(giveplayerid)); // I forgot to put the ; here. Sorry, it will work now. haha.
            SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string2);
        }
        else
        {
            SendClientMessageEx(playerid, COLOR_GREY, "Invalid ID!");
        }
    }
    else
    {
        SendClientMessageEx(playerid, COLOR_GREY, "You do not have a Badge!");
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)