if (strcmp("/frisk", cmdtext, true) == 0) { new teamid = GetPlayerTeam(playerid); if(teamid == 3) { tmp = strtok(cmdtext, idx); if(strlen(tmp) == 0) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /frisk[player id]"); new playeree = strval(tmp); if(!IsPlayerConnected(playeree)) return SendClientMessage(playerid, COLOR_WHITE, "Player is not connected."); new playername[MAX_PLAYER_NAME], adminname[MAX_PLAYER_NAME], gunname[32]; GetPlayerName(playeree, playername, MAX_PLAYER_NAME); GetPlayerName(playerid, adminname, MAX_PLAYER_NAME); new weaponid = GetPlayerWeapon(playeree); new money = GetPlayerMoney(playeree); GetWeaponName(weaponid ,gunname,sizeof(gunname)); format(string, sizeof(string), "|%s Has Weapon %s| money %i|", playername, gunname, money); SendClientMessage(playerid, COLOR_GOLD, string); format(string, sizeof(string), "%s Has frisked you for illegal iteams", adminname); SendClientMessage(playeree, COLOR_GOLD, string); } else if(teamid != 3) { SendClientMessage(playerid, COLOR_ROYALBLUE, "You Are Not A Officer"); } return 1; }
if(!strlen(tmp) == 0) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /frisk[player id]");
if(strcmp(cmd,"/frisk",true)==0) { if(IsPlayerConnected(playerid)) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "USAGE: /frisk [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 cannot Frisk yourself!"); return 1; } GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer)); GetPlayerName(playerid, sendername, sizeof(sendername)); new text1[20], text2[20], text3[20], text4[20], text5[25]; if(PlayerInfo[giveplayerid][pCrack] > 0) { text1 = "| Drugs."; } else { text1 = "| Empty Pocket."; } if(PlayerInfo[giveplayerid][pMats] > 1000) { text2 = "| Weapon Materials."; } else { text2 = "| Empty Pocket."; } if(PlayerInfo[giveplayerid][pPhoneBook] > 0) { text3 = "| Phone Book."; } else { text3 = "| Empty Pocket."; } if(PlayerInfo[giveplayerid][pCDPlayer] > 0) { text4 = "| CD-Player."; } else { text4 = "| Empty Pocket."; } new x_wep, xamm; GetPlayerWeaponData(giveplayerid, 10, x_wep, xamm); if(x_wep == 10 && xamm > 0){ SendClientMessage(playerid, COLOR_GREY, "Melee: Purple Dildo"); } if(x_wep == 11 && xamm > 0){ SendClientMessage(playerid, COLOR_GREY, "Melee: Small White Vibrator"); } if(x_wep == 12 && xamm > 0){ SendClientMessage(playerid, COLOR_GREY, "Melee: Large White Vibrator"); } if(x_wep == 13 && xamm > 0){ SendClientMessage(playerid, COLOR_GREY, "Melee: Silver Vibrator"); } if(x_wep == 14 && xamm > 0){ SendClientMessage(playerid, COLOR_GREY, "Melee: Flowers"); } if(x_wep == 15 && xamm > 0){ SendClientMessage(playerid, COLOR_GREY, "Melee: Cane"); } GetPlayerWeaponData(giveplayerid, 11, x_wep, xamm); if(x_wep == 44 && xamm > 0){ SendClientMessage(playerid, COLOR_GREY, "Special Weapon: Night Vision"); } if(x_wep == 45 && xamm > 0){ SendClientMessage(playerid, COLOR_GREY, "Special Weapon: Infrared Vision"); } if(x_wep == 46 && xamm > 0){ SendClientMessage(playerid, COLOR_GREY, "Special Weapon: Parachute"); } GetPlayerWeaponData(giveplayerid, 9, x_wep, xamm); if(x_wep == 41 && xamm > 0){ SendClientMessage(playerid, COLOR_GREY, "Special Tool: Pepper Spray"); } if(x_wep == 42 && xamm > 0){ SendClientMessage(playerid, COLOR_GREY, "Special Tool: Fire Extinguisher"); } if(x_wep == 43 && xamm > 0){ SendClientMessage(playerid, COLOR_GREY, "Special Tool: Camera"); } GetPlayerWeaponData(giveplayerid, 1, x_wep, xamm); if(x_wep == 2 && xamm > 0){ SendClientMessage(playerid, COLOR_GREY, "Melee: Golf Club"); } if(x_wep == 3 && xamm > 0){ SendClientMessage(playerid, COLOR_GREY, "Melee: Nightstick"); } if(x_wep == 4 && xamm > 0){ SendClientMessage(playerid, COLOR_GREY, "Melee: Knife"); } if(x_wep == 5 && xamm > 0){ SendClientMessage(playerid, COLOR_GREY, "Melee: Baseball Bat"); } if(x_wep == 6 && xamm > 0){ SendClientMessage(playerid, COLOR_GREY, "Melee: Shovel"); } if(x_wep == 7 && xamm > 0){ SendClientMessage(playerid, COLOR_GREY, "Melee: Pool Cue"); } if(x_wep == 8 && xamm > 0){ SendClientMessage(playerid, COLOR_GREY, "Melee: Katana"); } if(x_wep == 9 && xamm > 0){ SendClientMessage(playerid, COLOR_GREY, "Melee: Chainsaw"); } GetPlayerWeaponData(giveplayerid, 2, x_wep, xamm); if(x_wep == 22 && xamm > 0){ SendClientMessage(playerid, COLOR_GREY, "Pistol: 9mm"); } if(x_wep == 23 && xamm > 0){ SendClientMessage(playerid, COLOR_GREY, "Pistol: Silenced 9mm"); } if(x_wep == 24 && xamm > 0){ SendClientMessage(playerid, COLOR_GREY, "Pistol: Desert Eagle"); } GetPlayerWeaponData(giveplayerid, 3, x_wep, xamm); if(x_wep == 25 && xamm > 0){ SendClientMessage(playerid, COLOR_GREY, "Shotgun: Shotgun"); } if(x_wep == 26 && xamm > 0){ SendClientMessage(playerid, COLOR_LIGHTRED, "Unscripted: Sawnoff /report or /ban me please"); } if(x_wep == 27 && xamm > 0){ SendClientMessage(playerid, COLOR_GREY, "Shotgun: Combat Shotgun"); } GetPlayerWeaponData(giveplayerid, 4, x_wep, xamm); if(x_wep == 29 && xamm > 0){ SendClientMessage(playerid, COLOR_GREY, "Assault: MP5"); } if(x_wep == 28 && xamm > 0){ SendClientMessage(playerid, COLOR_LIGHTRED, "Unscripted: Mac 10 /report or /ban me please"); } if(x_wep == 32 && xamm > 0){ SendClientMessage(playerid, COLOR_LIGHTRED, "Unscripted: Tec9 /report or /ban me please"); } GetPlayerWeaponData(giveplayerid, 5, x_wep, xamm); if(x_wep == 31 && xamm > 0){ SendClientMessage(playerid, COLOR_GREY, "Assault: M4"); } if(x_wep == 30 && xamm > 0){ SendClientMessage(playerid, COLOR_GREY, "Assault: AK-47"); } GetPlayerWeaponData(giveplayerid, 6, x_wep, xamm); if(x_wep == 33 && xamm > 0){ SendClientMessage(playerid, COLOR_GREY, "Rifle: Country Rifle"); } if(x_wep == 34 && xamm > 0){ SendClientMessage(playerid, COLOR_GREY, "Rifle: Sniper Rifle"); } GetPlayerWeaponData(giveplayerid, 7, x_wep, xamm); if(x_wep == 35 && xamm > 0){ SendClientMessage(playerid, COLOR_LIGHTRED, "Unscripted: RPG /report or /ban me please"); } if(x_wep == 36 && xamm > 0){ SendClientMessage(playerid, COLOR_LIGHTRED, "Unscripted: HS RPG /report or /ban me please"); } if(x_wep == 37 && xamm > 0){ SendClientMessage(playerid, COLOR_LIGHTRED, "Unscripted: Flamethrower /report or /ban me please"); } if(x_wep == 38 && xamm > 0){ SendClientMessage(playerid, COLOR_LIGHTRED, "Unscripted: Minigun /report or /ban me please"); } GetPlayerWeaponData(giveplayerid, 8, x_wep, xamm); if(x_wep == 17 && xamm > 0){ SendClientMessage(playerid, COLOR_GREY, "Projectile: Smoke Grenade"); } if(x_wep == 18 && xamm > 0){ SendClientMessage(playerid, COLOR_GREY, "Projectile: Molotov Cocktail"); } if(x_wep == 39 && xamm > 0){ SendClientMessage(playerid, COLOR_LIGHTRED, "Unscripted: Satchel Charge /report or /ban me please"); } if(x_wep == 16 && xamm > 0){ SendClientMessage(playerid, COLOR_LIGHTRED, "Unscripted: Grenade /report or /ban me please"); } format(string, sizeof(string), "|__________ Items with %s __________|", giveplayer); SendClientMessage(playerid, COLOR_WHITE, string); format(string, sizeof(string), "%s.", text1); SendClientMessage(playerid, COLOR_GREY, string); format(string, sizeof(string), "%s.", text2); SendClientMessage(playerid, COLOR_GREY, string); format(string, sizeof(string), "%s.", text3); SendClientMessage(playerid, COLOR_GREY, string); format(string, sizeof(string), "%s.", text4); SendClientMessage(playerid, COLOR_GREY, string); format(string, sizeof(string), "%s.", text5); SendClientMessage(playerid, COLOR_GREY, string); if(PlayerInfo[playerid][pLeader] == 1 || PlayerInfo[playerid][pMember] == 1) { format(string, sizeof(string), "* %s searches %s for any illegal items.", sendername ,giveplayer); ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL E,COLOR_PURPLE); } else { format(string, sizeof(string), "* %s has frisked %s.", sendername ,giveplayer); ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL E,COLOR_PURPLE); } } 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; } |
CMD:frisk(playerid,params[])
{
if(teamid != 3) return SendClientMessage(playerid,-1,"ERROR:Only Officers can use this command!");
else
{
new id;
if(sscanf(params,"u"id)) return SendClientMessage(playerid,-1,"ERROR:/frisk [playerid]");
if(!IsPlayerConnected(id)||id == INVALID_PLAYER_ID) return SendClientMessage(playerid,-1,"ERROR:This Player isn't connected!");
else
{
//follow the way and do what you want