SA-MP Forums Archive
/hfind problems - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: /hfind problems (/showthread.php?tid=358505)



/hfind problems - Strech - 10.07.2012

I got problems with command /hfind for HA.
pawn Код:
CMD:hfind(playerid, params[])
{
    if(PlayerInfo[playerid][pMember] == 8)
    {
        SendClientMessageEx(playerid, COLOR_GREY, "You're not a Hitman.");
        return 1;
    }
    new string[128], giveplayerid;
    if(sscanf(params, "u", giveplayerid)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /hfind [playerid]");

    if(IsPlayerConnected(giveplayerid))
    {
        if(giveplayerid == playerid) { SendClientMessageEx(playerid, COLOR_GREY, "You can't use this command on yourself."); return 1; }
        if(GetPlayerInterior(giveplayerid)!=0) { SendClientMessageEx(playerid, COLOR_GREY, "That person is inside an interior."); return 1; }
        if(PlayerInfo[giveplayerid][pAdmin] >= 2 && PlayerInfo[giveplayerid][pAdminDuty] == 1) { SendClientMessageEx(playerid, COLOR_GREY, "You are unable to find this person."); return 1; }
        SetPlayerMarkerForPlayer(playerid, giveplayerid, FIND_COLOR);
        new zone[MAX_ZONE_NAME];
        GetPlayer3DZone(giveplayerid, zone, sizeof(zone));
        format(string, sizeof(string), "%s has been last seen at %s.", GetPlayerNameEx(giveplayerid), zone);
        SendClientMessageEx(playerid, COLOR_GRAD2, string);
        FindingPlayer[playerid]=giveplayerid;
        FindTime[playerid] = 3;
        SendClientMessageEx(playerid, COLOR_GREY, "Invalid player specified.");
    }
    return 1;
}
Can you helpme?i want if the player is HA member to be alowed to use /hfind and player to be tracked unlimited time with a checkpoint.I tryed everything but something is wrong.If he is not HA,he can't use it.Thats what i actually tryin to make.


Re : /hfind problems - Ataraxia - 10.07.2012

Try this :

pawn Код:
CMD:hfind(playerid, params[])
{
    if(PlayerInfo[playerid][pMember] != 8)
    {
        SendClientMessageEx(playerid, COLOR_GREY, "You're not a Hitman.");
        return 1;
    }
    new string[128], giveplayerid;
    if(sscanf(params, "u", giveplayerid)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /hfind [playerid]");

    if(IsPlayerConnected(giveplayerid))
    {
        if(giveplayerid == playerid) { SendClientMessageEx(playerid, COLOR_GREY, "You can't use this command on yourself."); return 1; }
        if(GetPlayerInterior(giveplayerid)!=0) { SendClientMessageEx(playerid, COLOR_GREY, "That person is inside an interior."); return 1; }
        if(PlayerInfo[giveplayerid][pAdmin] >= 2 && PlayerInfo[giveplayerid][pAdminDuty] == 1) { SendClientMessageEx(playerid, COLOR_GREY, "You are unable to find this person."); return 1; }
        SetPlayerMarkerForPlayer(playerid, giveplayerid, FIND_COLOR);
        new zone[MAX_ZONE_NAME];
        GetPlayer3DZone(giveplayerid, zone, sizeof(zone));
        format(string, sizeof(string), "%s has been last seen at %s.", GetPlayerNameEx(giveplayerid), zone);
        SendClientMessageEx(playerid, COLOR_GRAD2, string);
        FindingPlayer[playerid]=giveplayerid;
        FindTime[playerid] = 3;
        SendClientMessageEx(playerid, COLOR_GREY, "Invalid player specified.");
    }
    return 1;
}