Impossible!
#1

Guys this is so impossible for me I'm trying wasting hours for this but I can't make it work
What I want to make is to add few things if player is in car he can't use command, if other player is in car he can't use this command on him, if he is not in rage of player he can't perform this action on him, but in my command I get only 2 messages "you are not a cop" and "invalid player id" ANYTHING else I added nothing is working, why the hell? I commented a line also which is not working... and everything else I added but I deleted it wasn't working :/

pawn Код:
if(strcmp(cmd, "/frisk", true) == 0)
    {
        if(IsPlayerCop(playerid))
        {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_LIGHTGREEN, "Usage: /frisk [PlayerID]");
            new otherplayer = strval(tmp); // giveplayerid
            new Count, x; // warning line
            new string[128], string2[64];
            new WeapName[24], slot, weap, ammo;
            if(IsPlayerConnected(otherplayer) && otherplayer != INVALID_PLAYER_ID)
            {
                if(otherplayer == playerid) // THIS is not working
                {
                    format(string2,sizeof(string2),"_______|- %s's Weapons -|_______", otherplayer);
                    SendClientMessage(playerid,COLOR_LIGHTGREEN,string2);
                    for(slot = 0; slot < 14; slot++)
                    {
                    GetPlayerWeaponData(otherplayer, slot, weap, ammo);
                    if( ammo != 0 && weap != 0)
                    Count++;
                    }
                    if(Count < 1)
                    return SendClientMessage(playerid,COLOR_LIGHTGREEN,"No Weapons found!");
                    if(Count >= 1)
                    {
                        for (slot = 0; slot < 14; slot++)
                        {
                        GetPlayerWeaponData(otherplayer, slot, weap, ammo);
                        if( ammo != 0 && weap != 0)
                        {
                        GetWeaponName(weap, WeapName, sizeof(WeapName));
                        if(ammo == 65535 || ammo == 1)
                        format(string,sizeof(string),"%s%s (1)",string, WeapName);
                        else format(string,sizeof(string),"%s%s (%d)",string, WeapName, ammo);
                        x++;
                        if(x >= 5)
                        {
                        SendClientMessage(playerid, COLOR_LIGHTGREEN, string);
                        x = 0;
                        format(string, sizeof(string), "");
                        }
                        else format(string, sizeof(string), "%s,  ", string);
                        }
                        }
                        if(x <= 4 && x > 0)
                        {
                        string[strlen(string)-3] = '.';
                        SendClientMessage(playerid, COLOR_LIGHTGREEN, string);
                        }
                    }
                    return 1;
                }
                else return SendClientMessage(playerid,COLOR_LIGHTGREEN,"You can't frisk yourself!");
            }
            else return SendClientMessage(playerid,COLOR_LIGHTGREEN,"Invalid player ID!");
        }
        else return SendClientMessage(playerid,COLOR_LIGHTGREEN,"You are not cop!");
    }
    return 0;
}
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: 7 Guest(s)