(HELP) /checkreg COMMAND
#1

I need command for cops /checkreg
That will check that man who siting in some vehicle
if that vehicle where is that person siting if it is him

Example: If person who siting in car is Jack_Willson and car is his and it's registered on him
it will show Car is Registered to Jack_Willson so cop will know that is his car and it's not jacked,

If in the car siting Michael_Black and car is registered on Jack_Willson
so cop will se Car is registered on Jack_Willson normally, but now cops know that car is not Michael's
and they now know that he robbed car, or he will say he have borrowed it, so must RP it normally that he borowed it(we will promise in /do, there people can't lie on RP) THX guys, i hope someone can help

If you don't know about what i'm talking, ask i will tell you.
Reply
#2

hmm whats your vehicleveriable ? if u use a vehiclesystem post here the code so we can help you
Reply
#3

pawn Код:
if(IsAnOwnableCar(newcar))
        {
            if(CarInfo[newcar][cOwned]==0)
            {
                TogglePlayerControllable(playerid, 0);
                format(string,sizeof(string),"~w~Vehicle: %s~n~Price: ~g~%d~n~~w~/v buy to buy this vehicle~n~~r~/exit ~w~to exit this vehicle",CarInfo[newcar][cDescription],CarInfo[newcar][cValue]);
                GameTextForPlayer(playerid,string,5000,5);
            }
            if(CarInfo[newcar][cOwned]==1)
            {
                format(string,sizeof(string),"Vehicle registered to %s",CarInfo[newcar][cOwner]);
                SendClientMessage(playerid, COLOR_BLUE, string);
                /*if(keycar != vehicle)
                {
                    RemovePlayerFromVehicle(playerid);
                    SendClientMessage(playerid, COLOR_GREY, "You don't have a key of this vehicle");
                }*/

                if(PlayerInfo[playerid][pPcarkey] == vehicle) { }
                else if(PlayerInfo[playerid][pPcarkey2] == vehicle) { }
                else if(PlayerInfo[playerid][pPcarkey3] == vehicle) { }
    else
                {
        if(PlayerInfo[playerid][pAdmin] >= 1337 && AdminDuty[playerid] == 1)
                    {
                        SendClientMessage(playerid, COLOR_GREY, "  You can drive this car because you are admin on duty !");
     }
        else
                    {
                       
                       SendClientMessage(playerid, COLOR_RED, "This car isn't yours, drive carefully and don't let cops notice you");
                    }
                }
            }
        }
that's what you need, I think
Reply
#4

i made it in dcmd
you can inplement it to your script

pawn Код:
dcmd_checkreg(playerid,params[])
{
    new id;
    //if admin smaler as 2 it shows error thet he isnt an admin :=)
    //change your verriable to cop .... i think u can do it ^^
    if(PlayerInfo[playerid][pAdmin] <2) return SendClientMessage(playerid,-1,"You must be an cop/admin");
    else if(sccanf(params,"u",id)) return SendClientMessage(playerid,-1,"Usage: /checkreg <playerid/part of name>"
    else if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid,-1,"Player not online");
    else
    {
        new vehicle = GetPlyerVehicleId(id);
        if(PlayerInfo[id][pPcarkey] == vehicle)
        {
            new s[256],name[24];
            GetPlayerName(id,name,sizeof name);
            format(s,sizeof s,"This Car is Owned by %s",name);
            SendClientMessage(playerid,-1,s);
        }
        else
        {
            new s[256];
            format(s,sizeof s,"This Car is Owned by %s",CarInfo[vehicle][cOwner]);
            SendClientMessage(playerid,-1,s);
        }
    }
    return 1;
}
not testet but i think it works
Reply
#5

pawn Код:
//if admin smaler as 2 it shows error thet he isnt an admin :=)
what is that?
Reply
#6

Wait, I know, but i don't want that command for admin i'll delete
Reply
#7

if(PlayerInfo[playerid][pAdmin] <2) return SendClientMessage(playerid,-1,"You must be an cop/admin");
if he dont an admin lvl 2 he got the returned message


edit: set you color to another
Reply
#8

What? What color i need that command only for cops, admin can't do it, only cops
Reply
#9

change -1 to another color
example SendClientMessage(playerid,COLOR_GRED,"^^");

EDIT: i think if color = -1 it doesent shows the message
Reply
#10

I have it like this
pawn Код:
}
dcmd_checkreg(playerid,params[])
{
    new id;
   
    if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1) return SendClientMessage(playerid,-1,"You must be an cop/admin");
    else if(sccanf(params,"u",id)) return SendClientMessage(playerid,-1,"Usage: /checkreg <playerid/part of name>"
    else if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid,-1,"Player not online");
    else
    {
        new vehicle = GetPlyerVehicleId(id);
        if(PlayerInfo[id][pPcarkey] == vehicle)
        {
            new s[256],name[24];
            GetPlayerName(id,name,sizeof name);
            format(s,sizeof s,"This Car is Owned by %s",name);
            SendClientMessage(playerid,-1,s);
        }
        else
        {
            new s[256];
            format(s,sizeof s,"This Car is Owned by %s",CarInfo[vehicle][cOwner]);
            SendClientMessage(playerid,-1,s);
        }
    }
    return 1;
}
and i got this warning
Quote:

warning 203: symbol is never used: "dcmd_checkreg"

I dont know how to solve this warning right now
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)