if(strcmp(cmd, "/showbadge", true) == 0) { if(IsPlayerConnected(playerid)) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GREY, " USAGE: /showbadge [playerid]"); return 1; } new para1; para1 = ReturnUser(tmp); giveplayerid = ReturnUser(tmp); if (PlayerInfo[playerid][pLAERank] >= 1) { if(IsPlayerConnected(para1)) { if(giveplayerid != INVALID_PLAYER_ID) { GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer)); GetPlayerName(playerid, sendername, sizeof(sendername)); new length = strlen(cmdtext); while ((idx < length) && (cmdtext[idx] <= ' ')) if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GREY, " USAGE: /showbadge [playerid]"); return 1; } format(string, sizeof(string), "Police Officer %s BlahBlah...", sendername); SendClientMessage(para1, COLOR_BLUE, string); format(string, sizeof(string), "You have shown %s your badge.", giveplayer); SendClientMessage(playerid, COLOR_BLUE, string); return 1; } } } } return 1; }
Originally Posted by Torran
I dont xd, Maybe explain a little better
|
if(strcmp(cmd, "/showbadge", true) == 0) { if(IsPlayerConnected(playerid)) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GREY, " USAGE: /showbadge [playerid]"); return 1; } new para1; new laerank = PlayerInfo[playerid][pLAERank]; para1 = ReturnUser(tmp); giveplayerid = ReturnUser(tmp); if (PlayerInfo[playerid][pLAERank] >= 1) { if(IsPlayerConnected(para1)) { if(giveplayerid != INVALID_PLAYER_ID) { if (GetDistanceBetweenPlayers(playerid,giveplayerid) > 5) { SendClientMessage(playerid, COLOR_GREY, " You are too far away from the player."); return 1; } GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer)); GetPlayerName(playerid, sendername, sizeof(sendername)); new length = strlen(cmdtext); while ((idx < length) && (cmdtext[idx] <= ' ')) if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GREY, " USAGE: /showbadge [playerid]"); return 1; } format(string, sizeof(string), "%d %s BlahBlah...", laerank, sendername); SendClientMessage(para1, COLOR_BLUE, string); format(string, sizeof(string), "You have shown %s your badge.", giveplayer); SendClientMessage(playerid, COLOR_BLUE, string); return 1; } } } } return 1; }
if(strcmp(cmd,"/showbadge",true)==0)
{
if(IsPlayerConnected(playerid)) {
if(IsACop(playerid) || IsAPrisonGuard(playerid)) {
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /showbadge [playerid/PartOfName]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if(IsPlayerConnected(giveplayerid)) {
if(giveplayerid != INVALID_PLAYER_ID) {
if (ProxDetectorS(8.0, playerid, giveplayerid)) {
if(giveplayerid == playerid) { SendClientMessage(playerid, COLOR_GREY, "You cant show your badge to yourself!"); return 1; }
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
//GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s takes out his/her badge from his/her pocket.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
GetPlayerName(playerid,sendername,sizeof(sendername));
if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1) {
if(PlayerInfo[playerid][pRank] == 11) { format(string, sizeof(string), "** Rank/Name: Chief of Police - %s", sendername); }
else if(PlayerInfo[playerid][pRank] == 10) { format(string, sizeof(string), "** Rank/Name: Commander - %s", sendername); }
else if(PlayerInfo[playerid][pRank] == 9) { format(string, sizeof(string), "** Rank/Name: Captain - %s", sendername); }
else if(PlayerInfo[playerid][pRank] == 8) { format(string, sizeof(string), "** Rank/Name: Lieutenant - %s", sendername); }
else if(PlayerInfo[playerid][pRank] == 7) { format(string, sizeof(string), "** Rank/Name: Staff Sergeant - %s", sendername); }
else if(PlayerInfo[playerid][pRank] == 6) { format(string, sizeof(string), "** Rank/Name: Sergeant - %s", sendername); }
else if(PlayerInfo[playerid][pRank] == 5) { format(string, sizeof(string), "** Rank/Name: Senior Lead Officer - %s", sendername); }
else if(PlayerInfo[playerid][pRank] == 4) { format(string, sizeof(string), "** Rank/Name: Lead Officer - %s", sendername); }
else if(PlayerInfo[playerid][pRank] == 3) { format(string, sizeof(string), "** Rank/Name: Police Officer II - %s", sendername); }
else if(PlayerInfo[playerid][pRank] == 2) { format(string, sizeof(string), "** Rank/Name: Police Officer I - %s", sendername); }
else if(PlayerInfo[playerid][pRank] == 1) { format(string, sizeof(string), "** Rank/Name: Cadet - %s", sendername); }
}
else if(PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pLeader] == 2) {
if(PlayerInfo[playerid][pRank] == 6) { format(string, sizeof(string), "** FBI Rank/Name: Director - %s ", sendername); }
else if(PlayerInfo[playerid][pRank] == 5) { format(string, sizeof(string), "** FBI Rank/Name: Deputy Director - %s ", sendername); }
else if(PlayerInfo[playerid][pRank] == 4) { format(string, sizeof(string), "** FBI Rank/Name: Commander - %s ", sendername); }
else if(PlayerInfo[playerid][pRank] == 3) { format(string, sizeof(string), "** FBI Rank/Name: Intelligence Agent - %s ", sendername); }
else if(PlayerInfo[playerid][pRank] == 2) { format(string, sizeof(string), "** FBI Rank/Name: Special Agent - %s ", sendername); }
else if(PlayerInfo[playerid][pRank] == 1) { format(string, sizeof(string), "** FBI Rank/Name: Trainee Agent - %s ", sendername); }
}
else if(IsAPrisonGuard(playerid)) {
if(PlayerInfo[playerid][pRank] == 6) { format(string, sizeof(string), "** LS Prison Rank/Name: Warden - %s ", sendername); }
else if(PlayerInfo[playerid][pRank] == 5) { format(string, sizeof(string), "** LS Prison Rank/Name: Deputy Warden - %s ", sendername); }
else if(PlayerInfo[playerid][pRank] == 4) { format(string, sizeof(string), "** LS Prison Rank/Name: Guard`s Commander - %s ", sendername); }
else if(PlayerInfo[playerid][pRank] == 3) { format(string, sizeof(string), "** LS Prison Rank/Name: Senior Guard - %s ", sendername); }
else if(PlayerInfo[playerid][pRank] == 2) { format(string, sizeof(string), "** LS Prison Rank/Name: Guard - %s ", sendername); }
else if(PlayerInfo[playerid][pRank] == 1) { format(string, sizeof(string), "** LS Prison Rank/Name: Trainee - %s ", sendername); }
}
SendClientMessage(giveplayerid, COLOR_GREY, string);
format(string, sizeof(string), "* %s has shown his/her badge to you.", sendername);
SendClientMessage(giveplayerid, COLOR_GREY, string);
format(string, sizeof(string), "* You have shown your Badge to %s.", giveplayer);
SendClientMessage(playerid, COLOR_GREY, string);
}
else {
SendClientMessage(playerid, COLOR_GREY, " That player is not near you!");
return 1;
}
}
}
else {
SendClientMessage(playerid, COLOR_GREY, " That player is Offline!");
return 1;
}
}
}
return 1;
}
Originally Posted by Souvlaki
I hope this will help.I made this for my GM.I think you can take an idea to make your own,
pawn Code:
|
if(strcmp(cmd, "/showbadge", true) == 0) { if(IsPlayerConnected(playerid)) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GREY, " USAGE: /showbadge [playerid]"); return 1; } new para1; para1 = ReturnUser(tmp); giveplayerid = ReturnUser(tmp); if(gTeam[playerid] == TEAM_LSPD) { if(PlayerInfo[playerid][pLAERank] >= 1) { if(IsPlayerConnected(para1)) { if(giveplayerid != INVALID_PLAYER_ID) { if (GetDistanceBetweenPlayers(playerid,giveplayerid) > 5) { SendClientMessage(playerid, COLOR_GREY, " You are too far away from the player."); return 1; } GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer)); GetPlayerName(playerid, sendername, sizeof(sendername)); new length = strlen(cmdtext); while ((idx < length) && (cmdtext[idx] <= ' ')) if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GREY, " USAGE: /showbadge [playerid]"); return 1; } format(string, sizeof(string), "* %s takes hold of his badge and shows it to %s.", sendername, giveplayer); ProxDetector(30.0, playerid, string, COLOR_LILAC,COLOR_LILAC,COLOR_LILAC,COLOR_LILAC,COLOR_LILAC); if(PlayerInfo[playerid][pLAERank] == 10) { format(string, sizeof(string), "Chief of Police %s", sendername); } else if(PlayerInfo[playerid][pLAERank] == 9) { format(string, sizeof(string), "Assistant Chief %s", sendername); } else if(PlayerInfo[playerid][pLAERank] == 8) { format(string, sizeof(string), "Deputy Chief %s", sendername); } else if(PlayerInfo[playerid][pLAERank] == 7) { format(string, sizeof(string), "Commander %s", sendername); } else if(PlayerInfo[playerid][pLAERank] == 6) { format(string, sizeof(string), "Captain %s", sendername); } else if(PlayerInfo[playerid][pLAERank] == 5) { format(string, sizeof(string), "Lieutenant %s", sendername); } else if(PlayerInfo[playerid][pLAERank] == 4) { format(string, sizeof(string), "Sergeant %s", sendername); } else if(PlayerInfo[playerid][pLAERank] == 3) { format(string, sizeof(string), "Detective %s", sendername); } else if(PlayerInfo[playerid][pLAERank] == 2) { format(string, sizeof(string), "Senior Lead Officer %s", sendername); } else if(PlayerInfo[playerid][pLAERank] == 1) { format(string, sizeof(string), "Police Officer %s", sendername); } } } } else { SendClientMessage(playerid, COLOR_GREY, " You are not authorized to use that command."); return 1; } } else { SendClientMessage(playerid, COLOR_GREY, " You are not a Police Officer."); return 1; } } return 1; }
if(strcmp(cmd, "/showbadge", true) == 0) { if(IsPlayerConnected(playerid)) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GREY, " USAGE: /showbadge [playerid]"); return 1; } new para1; para1 = ReturnUser(tmp); giveplayerid = ReturnUser(tmp); if(gTeam[playerid] == TEAM_LSPD) { if(PlayerInfo[playerid][pLAERank] >= 1) { if(IsPlayerConnected(para1)) { if(giveplayerid != INVALID_PLAYER_ID) { if (GetDistanceBetweenPlayers(playerid,giveplayerid) > 5) { SendClientMessage(playerid, COLOR_GREY, " You are too far away from the player."); return 1; } GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer)); GetPlayerName(playerid, sendername, sizeof(sendername)); new length = strlen(cmdtext); while ((idx < length) && (cmdtext[idx] <= ' ')) if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GREY, " USAGE: /showbadge [playerid]"); return 1; } format(string, sizeof(string), "* %s takes hold of his badge and shows it to %s.", sendername, giveplayer); ProxDetector(30.0, playerid, string, COLOR_LILAC,COLOR_LILAC,COLOR_LILAC,COLOR_LILAC,COLOR_LILAC); if(PlayerInfo[playerid][pLAERank] == 10) { format(string, sizeof(string), "Chief of Police %s, Los Santos Police Department.", sendername); } else if(PlayerInfo[playerid][pLAERank] == 9) { format(string, sizeof(string), "Assistant Chief %s, Los Santos Police Department.", sendername); } else if(PlayerInfo[playerid][pLAERank] == 8) { format(string, sizeof(string), "Deputy Chief %s, Los Santos Police Department.", sendername); } else if(PlayerInfo[playerid][pLAERank] == 7) { format(string, sizeof(string), "Commander %s, Los Santos Police Department.", sendername); } else if(PlayerInfo[playerid][pLAERank] == 6) { format(string, sizeof(string), "Captain %s, Los Santos Police Department.", sendername); } else if(PlayerInfo[playerid][pLAERank] == 5) { format(string, sizeof(string), "Lieutenant %s, Los Santos Police Department.", sendername); } else if(PlayerInfo[playerid][pLAERank] == 4) { format(string, sizeof(string), "Sergeant %s, Los Santos Police Department.", sendername); } else if(PlayerInfo[playerid][pLAERank] == 3) { format(string, sizeof(string), "Detective %s, Los Santos Police Department.", sendername); } else if(PlayerInfo[playerid][pLAERank] == 2) { format(string, sizeof(string), "Senior Lead Officer %s, Los Santos Police Department.", sendername); } else if(PlayerInfo[playerid][pLAERank] == 1) { format(string, sizeof(string), "Police Officer %s, Los Santos Police Department.", sendername); } SendClientMessage(giveplayerid, COLOR_BLUE, string); format(string, sizeof(string), "You have shown your badge to %s.", giveplayer); SendClientMessage(playerid, COLOR_BLUE, string); } } } else { SendClientMessage(playerid, COLOR_GREY, " You are not authorized to use that command."); return 1; } } else { SendClientMessage(playerid, COLOR_GREY, " You are not a Police Officer."); return 1; } } return 1; }