23.02.2010, 19:37
pawn Code:
if(strcmp(cmd, "/checkdrunk", true) == 0 || strcmp(cmd, "/cd", true) == 0)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GREY, "USAGE: /checkdrunk [playerid]");
return 1;
}
giveplayerid = strval(tmp);
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1)
{
if (ProxDetectorS(9.0, playerid, giveplayerid))
{
GetPlayerName(playerid, sendername, sizeof(sendername));
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
if(PlayerInfo[playerid][pMaskuse] == 1)
{
format(string, sizeof(string), "* Masked Stranger checks %s's Drunk level.", giveplayer);
}
else
{
format(string, sizeof(string), "* %s checks %s's Drunk level.", sendername);
}
ProxDetector(20.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
if(GetPlayerDrunkLevel(giveplayerid) > 1 && GetPlayerDrunkLevel(giveplayerid) < 1999)
{
SendClientMessage(playerid,0xFFFFFFFF,"He/She is not drunk.");
}
if(GetPlayerDrunkLevel(giveplayerid) > 2000 && GetPlayerDrunkLevel(giveplayerid) < 5000)
{
SendClientMessage(playerid,0xFFFFFFFF,"He/She is Drunk.");
}
if(GetPlayerDrunkLevel(giveplayerid) > 5001 && GetPlayerDrunkLevel(giveplayerid) < 50000)
{
SendClientMessage(playerid,0xFFFFFFFF,"He/She is Wasted!");
}
return 1;
}
else
{
SendClientMessage(playerid, COLOR_RED, "you are not around that player!");
}
return 1;
}
else
{
SendClientMessage(playerid, COLOR_RED,"You are not a Cop");
}
return 1;
}