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;
}
if (id == INVALID_PLAYER_ID)
{
SendClientMessage(playerid, COLOR_WHITE, "Invalid player ID!");
return 1;
}
if (IsPlayerInAnyVehicle(id))
{
SendClientMessage(playerid, COLOR_WHITE, "This player is in vehicle!");
return 1;
}
if (!IsPlayerInRangeOfPoint(id, 5.0, x, y, z))
{
SendClientMessage(playerid, COLOR_WHITE, "This player is to far away");
return 1;
}
// if is player connected...
format(Str2, sizeof(Str2), "__________%s's Weapon Information___________", Name);
SendClientMessage(playerid, COLOR_YELLOW, Str2);
for(Slot = 0; Slot < 14; Slot++)
{
GetPlayerWeaponData(id, Slot, Weapon, Ammo);
if( Ammo != 0 && Weapon != 0)
CNT++;
}
if(CNT < 1)
{
SendClientMessage(playerid,0x33AA33AA,"No weapons found!");
return 1;
}
if(CNT >= 1)
{
for (Slot = 0; Slot < 14; Slot++)
{
GetPlayerWeaponData(id, Slot, Weapon, Ammo);
if( Ammo != 0 && Weapon != 0)
{
GetWeaponName(Weapon,WN, sizeof(WN));
if(Ammo == 65535 || Ammo == 1)
format(Str,sizeof(Str),"%s%s (1)",Str, WN);
else format(Str,sizeof(Str),"%s%s (%d)",Str, WN, Ammo);
X++;
if(X >= 5)
{
SendClientMessage(playerid, 0x33AA33AA, Str);
X = 0;
format(Str, sizeof(Str), "");
}
else format(Str, sizeof(Str), "%s, ", Str);
}
}
if(X <= 4 && X > 0)
{
Str[strlen(Str)-3] = '.';
SendClientMessage(playerid, 0x33AA33AA, Str);
}
}
}
return 1;
}
return 0;
}
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;
}
if (IsPlayerInAnyVehicle(id))
{
SendClientMessage(playerid, COLOR_WHITE, "This player is in vehicle!");
return 1;
}
if (!IsPlayerInRangeOfPoint(id, 5.0, x, y, z))
{
SendClientMessage(playerid, COLOR_WHITE, "This player is to far away");
return 1;
}
// if is player connected...
format(Str2, sizeof(Str2), "__________%s's Weapon Information___________", Name);
SendClientMessage(playerid, COLOR_YELLOW, Str2);
for(Slot = 0; Slot < 14; Slot++)
{
GetPlayerWeaponData(id, Slot, Weapon, Ammo);
if( Ammo != 0 && Weapon != 0)
CNT++;
}
if(CNT < 1)
{
SendClientMessage(playerid,0x33AA33AA,"No weapons found!");
return 1;
}
if(CNT >= 1)
{
for (Slot = 0; Slot < 14; Slot++)
{
GetPlayerWeaponData(id, Slot, Weapon, Ammo);
if( Ammo != 0 && Weapon != 0)
{
GetWeaponName(Weapon,WN, sizeof(WN));
if(Ammo == 65535 || Ammo == 1)
format(Str,sizeof(Str),"%s%s (1)",Str, WN);
else format(Str,sizeof(Str),"%s%s (%d)",Str, WN, Ammo);
X++;
if(X >= 5)
{
SendClientMessage(playerid, 0x33AA33AA, Str);
X = 0;
format(Str, sizeof(Str), "");
}
else format(Str, sizeof(Str), "%s, ", Str);
}
}
if(X <= 4 && X > 0)
{
Str[strlen(Str)-3] = '.';
SendClientMessage(playerid, 0x33AA33AA, Str);
}
}
else
{
SendClientMessage(playerid, 0x33AA33AA, "No such a player");
return 1;
}
}
return 0;
}
if(strcmp(cmd,"/frisk",true) == 0)
{
if(IsPlayerConnected(playerid))
{
new Float:x, Float:y, Float:z;
tmp = strtok(cmdtext, idx);
GetPlayerPos(playerid, x, y, z);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /frisk [playerid]");
return 1;
}
if (!IsPlayerConnected(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "Invalid player ID!");
return 1;
}
if (IsPlayerInAnyVehicle(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "This player is in vehicle!");
return 1;
}
if (!IsPlayerInRangeOfPoint(tmp, 5.0, x, y, z))
{
SendClientMessage(playerid, COLOR_WHITE, "This player is to far away");
return 1;
}
// if is player connected...
format(Str2, sizeof(Str2), "__________%s's Weapon Information___________", Name);
SendClientMessage(playerid, COLOR_YELLOW, Str2);
for(Slot = 0; Slot < 14; Slot++)
{
GetPlayerWeaponData(tmp, Slot, Weapon, Ammo);
if( Ammo != 0 && Weapon != 0)
CNT++;
}
if(CNT < 1)
{
SendClientMessage(playerid,0x33AA33AA,"No weapons found!");
return 1;
}
if(CNT >= 1)
{
for (Slot = 0; Slot < 14; Slot++)
{
GetPlayerWeaponData(tmp, Slot, Weapon, Ammo);
if( Ammo != 0 && Weapon != 0)
{
GetWeaponName(Weapon,WN, sizeof(WN));
if(Ammo == 65535 || Ammo == 1)
format(Str,sizeof(Str),"%s%s (1)",Str, WN);
else format(Str,sizeof(Str),"%s%s (%d)",Str, WN, Ammo);
X++;
if(X >= 5)
{
SendClientMessage(playerid, 0x33AA33AA, Str);
X = 0;
format(Str, sizeof(Str), "");
}
else format(Str, sizeof(Str), "%s, ", Str);
}
}
if(X <= 4 && X > 0)
{
Str[strlen(Str)-3] = '.';
SendClientMessage(playerid, 0x33AA33AA, Str);
}
}
}
return 1;
}
if(id == INVALID_PLAYER_ID) |
if(!IsPlayerConnected(tmp))
new id = strval(tmp);