Impossible!
#8

pawn Код:
if(strcmp(cmd, "/frisk", true) == 0)
{
    if(!IsPlayerCop(playerid)) SendClientMessage(playerid,COLOR_LIGHTGREEN,"You are not cop!");
    else if(IsPlayerInAnyVehicle(playerid)) SendClientMessage(playerid,COLOR_LIGHTGREEN,"You can't use this cmd in vehicle!");
    else{
        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_LIGHTGREEN, "Usage: /frisk [PlayerID]");
        new otherplayer = strval(tmp); // giveplayerid
        if(!IsPlayerConnected(otherplayer)) SendClientMessage(playerid,COLOR_LIGHTGREEN,"Invalid player ID!");
        else if(otherplayer == playerid) SendClientMessage(playerid,COLOR_LIGHTGREEN,"You can't frisk yourself!");
        else if(IsPlayerInAnyVehicle(otherplayer)) SendClientMessage(playerid,COLOR_LIGHTGREEN,"That player is in vehicle!");
        else{
            new Float:X, Float:Y, Float:Z;
            GetPlayerPos(playerid, X, Y, Z);
            if(!IsPlayerInRangeOfPoint(otherplayer, Range_Here, X, Y, Z)) SendClientMessage(playerid,COLOR_LIGHTGREEN,"You are not close enough to frisk that player!");
            else{
                new string[128],szName[MAX_PLAYER_NAME + 1];
                GetPlayerName(otherplayer, szName, MAX_PLAYER_NAME);
                format(string,sizeof(string),"_______|- %s's Weapons -|_______", szName);
                SendClientMessage(playerid,COLOR_LIGHTGREEN,string);
                for(slot = 0; slot != 13; slot++)
                {
                    GetPlayerWeaponData(otherplayer, slot, weap, ammo);
                    if(weap != 0 && ammo != 0)
                        Count++;
                }
                if(!Count) SendClientMessage(playerid,COLOR_LIGHTGREEN,"No Weapons found!");
                else{
                    string[0] = '\0';
                    new WeapName[32], weap, ammo, x;
                    for(slot = 0; slot != 13; slot++)
                    {
                        GetPlayerWeaponData(otherplayer, slot, weap, ammo);
                        if(weap != 0 && ammo != 0)
                        {
                            GetWeaponName(weap, WeapName, sizeof(WeapName));
                            format(string,sizeof(string),"%s%s (%d), ",string, WeapName, ammo),x++;
                            if(x > 4)
                            {
                                x = 0;
                                string[strlen(string) - 2] = 0;
                                SendClientMessage(playerid, COLOR_LIGHTGREEN, string);
                                string[0] = '\0';
                            }
                        }
                    }
                    if(x > 0)
                    {
                        string[strlen(string) - 2] = '.';
                        SendClientMessage(playerid, COLOR_LIGHTGREEN, string);
                    }
                }
            }
        }
    }
    return 1;
}
Reply


Messages In This Thread
Impossible! - by Lajko1 - 31.10.2013, 16:19
Re: Impossible! - by Jefff - 31.10.2013, 16:43
Re: Impossible! - by coool - 31.10.2013, 16:49
Re: Impossible! - by Lajko1 - 31.10.2013, 16:59
Re: Impossible! - by Jefff - 31.10.2013, 17:04
Re: Impossible! - by Lajko1 - 31.10.2013, 18:50
Re: Impossible! - by Lajko1 - 31.10.2013, 18:54
Re: Impossible! - by Jefff - 31.10.2013, 20:39
Re: Impossible! - by Lajko1 - 31.10.2013, 22:38

Forum Jump:


Users browsing this thread: 4 Guest(s)