PDA

View Full Version : Help with something please as fast as you can!


joko2021
30/07/2014, 09:28 PM
here's the /badge command and i want /hbadge command that can be used by hitman only to show any badge of following factions he want
COMMAND:badge(playerid, params[])
{
if( GetPlayerFaction(playerid) != COPS &&
GetPlayerFaction(playerid) != SASF &&
GetPlayerFaction(playerid) != FBI) return SendClientError(playerid, CANT_USE_CMD);
new iPlayer;
if( sscanf ( params, "u", iPlayer)) return SCP(playerid, "[PlayerID/PartOfName]");
if(!IsPlayerConnected(iPlayer)) return SendClientError(playerid, PLAYER_NOT_FOUND);
if(GetDistanceBetweenPlayers(playerid, iPlayer) > 5) return SendClientError(playerid, "Too far away");

format(iStr, sizeof(iStr), "has shown their badge to %s.", MaskedName(iPlayer));
Action(playerid, iStr);


if (PlayerInfo[playerid][playerteam] == SASF)
{
SendClientMessage(iPlayer, COLOR_WHITE, "{3f9541}========= {7ada7d}[Government Badge] {3f9541}=========");
format(iStr, sizeof(iStr), " {7ada7d}Name: {FFFFFF}%s", RPName(playerid));
SendClientMessage(iPlayer, COLOR_WHITE, iStr);
format(iStr, sizeof(iStr), " {7ada7d}Employed at: {FFFFFF}%s", PlayerInfo[playerid][PTeamName]);
SendClientMessage(iPlayer, COLOR_WHITE, iStr);
format(iStr, sizeof(iStr), " {7ada7d}Position: {FFFFFF}%s", PlayerInfo[playerid][rankname]);
SendClientMessage(iPlayer, COLOR_WHITE, iStr);
SendClientMessage(iPlayer, COLOR_WHITE, "{3f9541}========= {7ada7d}[Government Badge] {3f9541}=========");
}
else if (PlayerInfo[playerid][playerteam] == FBI)
{
SendClientMessage(iPlayer, COLOR_WHITE, "{3f9541}========= {7ada7d}[Government Badge] {3f9541}=========");
format(iStr, sizeof(iStr), " {7ada7d}Name: {FFFFFF}Stranger");
SendClientMessage(iPlayer, COLOR_WHITE, iStr);
format(iStr, sizeof(iStr), " {7ada7d}Employed at: {FFFFFF}%s", PlayerInfo[playerid][PTeamName]);
SendClientMessage(iPlayer, COLOR_WHITE, iStr);
format(iStr, sizeof(iStr), " {7ada7d}Position: {FFFFFF}%s", PlayerInfo[playerid][rankname]);
SendClientMessage(iPlayer, COLOR_WHITE, iStr);
SendClientMessage(iPlayer, COLOR_WHITE, "{3f9541}========= {7ada7d}[Government Badge] {3f9541}=========");
}
else
{
SendClientMessage(iPlayer, COLOR_WHITE, "{3f9541}========= {7ada7d}[Government Badge] {3f9541}=========");
format(iStr, sizeof(iStr), " {7ada7d}Name: {FFFFFF}%s", RPName(playerid));
SendClientMessage(iPlayer, COLOR_WHITE, iStr);
format(iStr, sizeof(iStr), " {7ada7d}Employed at: {FFFFFF}%s", PlayerInfo[playerid][PTeamName]);
SendClientMessage(iPlayer, COLOR_WHITE, iStr);
format(iStr, sizeof(iStr), " {7ada7d}Position: {FFFFFF}%s", PlayerInfo[playerid][rankname]);
SendClientMessage(iPlayer, COLOR_WHITE, iStr);
SendClientMessage(iPlayer, COLOR_WHITE, "{3f9541}========= {7ada7d}[Government Badge] {3f9541}=========");
}
return 1;
}

i want /hbadge that fits with this code.

Thanks for helping me!

joko2021
30/07/2014, 11:06 PM
Please anyone help!

Don_Cage
30/07/2014, 11:18 PM
Try make it yourself..

I made something that will help you understand where to begin and how it could be made.
CMD:hbadge(playerid, params[])
{
if(/*if the player is hitman*/)
{
new badge[128], id;
if(sscanf(params,"us",id,badge)) return SendClientMessage(playerid, -1, "SYNTAX: /hbadge [Player] [Badge]");
if(sscanf(params,"badge1",badge))
{
/*
Code to show badge1
*/
}
if(sscanf(params,"badge2",badge))
{
/*
Code to show badge2
*/
}

joko2021
30/07/2014, 11:49 PM
Thanks for being helpful will try to make it now and will tell you.

joko2021
31/07/2014, 12:03 AM
here's the command i did but when i compile the compiler crashs
CMD:hbadge(playerid, params[])
{
if(PlayerInfo[playerid][playerteam] == HITMAN) return SendClientMessage,COLOR_RED, "[Error] You're not a hitman"
{
new badge[128], id;
if(sscanf(params,"us",id,badge)) return SendClientMessage(playerid, -1, "SYNTAX: /hbadge [Player] [Badge]");
if(sscanf(params,"badge1",badge))
{
SendClientMessage(iPlayer, COLOR_WHITE, "{3f9541}========= {7ada7d}[Government Badge] {3f9541}=========");
format(iStr, sizeof(iStr), " {7ada7d}Name: {FFFFFF}%s", RPName(playerid));
SendClientMessage(iPlayer, COLOR_WHITE, iStr);
format(iStr, sizeof(iStr), " {7ada7d}Employed at: {FFFFFF}S.A.S.F.", PlayerInfo[playerid]);
SendClientMessage(iPlayer, COLOR_WHITE, iStr);
format(iStr, sizeof(iStr), " {7ada7d}Position: {FFFFFF}N/A", PlayerInfo[playerid]);
SendClientMessage(iPlayer, COLOR_WHITE, iStr);
SendClientMessage(iPlayer, COLOR_WHITE, "{3f9541}========= {7ada7d}[Government Badge] {3f9541}=========");
}
if(sscanf(params,"badge2",badge))
{
SendClientMessage(iPlayer, COLOR_WHITE, "{3f9541}========= {7ada7d}[Government Badge] {3f9541}=========");
format(iStr, sizeof(iStr), " {7ada7d}Name: {FFFFFF}%s", RPName(playerid));
SendClientMessage(iPlayer, COLOR_WHITE, iStr);
format(iStr, sizeof(iStr), " {7ada7d}Employed at: {FFFFFF}F.B.I.", PlayerInfo[playerid]);
SendClientMessage(iPlayer, COLOR_WHITE, iStr);
format(iStr, sizeof(iStr), " {7ada7d}Position: {FFFFFF}N/A", PlayerInfo[playerid]);
SendClientMessage(iPlayer, COLOR_WHITE, iStr);
SendClientMessage(iPlayer, COLOR_WHITE, "{3f9541}========= {7ada7d}[Government Badge] {3f9541}=========");
}
if(sscanf(params,"badge3",badge))
{
SendClientMessage(iPlayer, COLOR_WHITE, "{3f9541}========= {7ada7d}[Government Badge] {3f9541}=========");
format(iStr, sizeof(iStr), " {7ada7d}Name: {FFFFFF}%s", RPName(playerid));
SendClientMessage(iPlayer, COLOR_WHITE, iStr);
format(iStr, sizeof(iStr), " {7ada7d}Employed at: {FFFFFF}Police", PlayerInfo[playerid]);
SendClientMessage(iPlayer, COLOR_WHITE, iStr);
format(iStr, sizeof(iStr), " {7ada7d}Position: {FFFFFF}N/A", PlayerInfo[playerid]);
SendClientMessage(iPlayer, COLOR_WHITE, iStr);
SendClientMessage(iPlayer, COLOR_WHITE, "{3f9541}========= {7ada7d}[Government Badge] {3f9541}=========");
}
return 1;
}

d3ll
31/07/2014, 12:42 AM
COMMAND:hbadge(playerid, params[])
{
if(GetPlayerFaction(playerid) == HITMAN)
{
new iPlayer;
if( sscanf ( params, "u", iPlayer)) return SCP(playerid, "[PlayerID/PartOfName]");
if(!IsPlayerConnected(iPlayer)) return SendClientError(playerid, PLAYER_NOT_FOUND);
if(GetDistanceBetweenPlayers(playerid, iPlayer) > 5) return SendClientError(playerid, "Too far away");

format(iStr, sizeof(iStr), "has shown their badge to %s.", MaskedName(iPlayer));
Action(playerid, iStr);

SendClientMessage(iPlayer, COLOR_WHITE, "{3f9541}========= {7ada7d}[Hitman Badge] {3f9541}=========");
format(iStr, sizeof(iStr), " {7ada7d}Name: {FFFFFF}%s", RPName(playerid));
SendClientMessage(iPlayer, COLOR_WHITE, iStr);
format(iStr, sizeof(iStr), " {7ada7d}Employed at: {FFFFFF}%s", PlayerInfo[playerid][PTeamName]);
SendClientMessage(iPlayer, COLOR_WHITE, iStr);
format(iStr, sizeof(iStr), " {7ada7d}Position: {FFFFFF}%s", PlayerInfo[playerid][rankname]);
SendClientMessage(iPlayer, COLOR_WHITE, iStr);
SendClientMessage(iPlayer, COLOR_WHITE, "{3f9541}========= {7ada7d}[HitmanBadge] {3f9541}=========");
}
else return SendClientError(playerid, CANT_USE_CMD);
return 1;
}

joko2021
31/07/2014, 01:48 PM
You made a command to show hitman badge but i don't want that i want a command in which when you're a hitman you can show a fake badge of FBI/SASF/LSPD