14.10.2010, 16:11
Alright, lately I was desperately trying to achieve my aim, which was creating a full /frisk command, seems like it doesn't work, it doesn't show the player's Weapon, when he has it on him, nor it works, can any one glance at my script and correct where it's needed, so that when I frisk some one it will show his Weapons.
*Everything is defined, additionally I made a variable for "Phasagun" by adding it with "Enum"
*Everything is defined, additionally I made a variable for "Phasagun" by adding it with "Enum"
pawn Код:
if(strcmp(cmd,"/frisk",true)==0 || strcmp(cmd,"/f",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(5.0, playerid, giveplayerid))
{
new pID;
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "|__________ %'s Weapons __________|", giveplayer);
SendClientMessage(playerid, COLOR_WHITE, string);
if(PlayerInfo[giveplayerid][phasagun] != 0)
{
new gunname[100];
GetWeaponName(pID, gunname, sizeof(gunname));
format(string, sizeof(string), "| Weapon: %s, Ammo: %d", gunname, pID);
SendClientMessage(playerid, COLOR_GREY, string);
}
else
{
SendClientMessage(playerid, COLOR_GREY, "| No Weapons were found.");
}
format(string, sizeof(string), " %s has frisked your weapon package.", sendername);
SendClientMessage(giveplayerid, COLOR_GREY, string);
return 1;
}
}
}
}
return 1;
}