Hello, I Have A Problem With /frisk command ,when i try to /frisk someone it doesnt ask the player if he accepts or deny it ,like when someone do /frisk [id] it Sends A Client Message says if he wants to get frisked or not ,if you have any ideas so post it please
pawn Код:
CMD:frisk(playerid, params[])
{
new string[128], giveplayerid;
if(sscanf(params, "u", giveplayerid)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /frisk [playerid]");
if(IsPlayerConnected(giveplayerid))
{
if (ProxDetectorS(8.0, playerid, giveplayerid))
{
if(giveplayerid == playerid) { SendClientMessageEx(playerid, COLOR_GREY, "You cannot frisk yourself!"); return 1; }
SendClientMessageEx(playerid, COLOR_GREEN, "_______________________________________");
format(string, sizeof(string), "*** %s' items... ***", GetPlayerNameEx(giveplayerid));
SendClientMessageEx(playerid, COLOR_WHITE, string);
if(PlayerInfo[giveplayerid][pPot] > 0)
{
format(string, sizeof(string), "%d grams of pot.", PlayerInfo[giveplayerid][pPot]);
SendClientMessageEx(playerid, COLOR_GREY, string);
}
if(PlayerInfo[giveplayerid][pWSeeds] == 1)
{
SendClientMessageEx(playerid, COLOR_GREY, "Marijuana Seeds");
}
if(PlayerInfo[giveplayerid][pCrack] > 0)
{
format(string, sizeof(string), "%d grams of crack.", PlayerInfo[giveplayerid][pCrack]);
SendClientMessageEx(playerid, COLOR_GREY, string);
}
if(PlayerInfo[giveplayerid][pMats] > 0)
{
format(string, sizeof(string), "%d materials.", PlayerInfo[giveplayerid][pMats]);
SendClientMessageEx(playerid, COLOR_GREY, string);
}
if(Fishes[giveplayerid][pWeight1] > 0 || Fishes[giveplayerid][pWeight2] > 0 || Fishes[giveplayerid][pWeight3] > 0 || Fishes[giveplayerid][pWeight4] > 0 || Fishes[giveplayerid][pWeight5] > 0)
{
format(string, sizeof(string), "%d fish.", PlayerInfo[giveplayerid][pFishes]);
SendClientMessageEx(playerid, COLOR_GREY, string);
}
if(PlayerInfo[giveplayerid][pPhoneBook] > 0) SendClientMessageEx(playerid, COLOR_GREY, "Phone book.");
if(PlayerInfo[giveplayerid][pCDPlayer] > 0) SendClientMessageEx(playerid, COLOR_GREY, "CD player.");
new weaponname[50];
format(string, sizeof(string), "*** %s' weapons... ***", GetPlayerNameEx(giveplayerid));
SendClientMessageEx(playerid, COLOR_WHITE, string);
for (new i = 0; i < 12; i++)
{
if(PlayerInfo[giveplayerid][pGuns][i] > 0)
{
GetWeaponName(PlayerInfo[giveplayerid][pGuns][i], weaponname, sizeof(weaponname));
format(string, sizeof(string), "Weapon: %s.", weaponname);
SendClientMessageEx(playerid, COLOR_GRAD1, string);
}
}
SendClientMessageEx(playerid, COLOR_GREEN, "_______________________________________");
format(string, sizeof(string), "* %s has frisked %s for any illegal items.", GetPlayerNameEx(playerid),GetPlayerNameEx(giveplayerid));
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
else
{
SendClientMessageEx(playerid, COLOR_GREY, "That player isn't near you.");
}
}
else
{
SendClientMessageEx(playerid, COLOR_GREY, "Invalid player specified.");
return 1;
}
return 1;
}