Police Impound
#1

Ok so i had someone add the police impound into my server well when your a civilian and type /impound it says you must be a police officer but when your a cop and type /impound it says SERVER COMMAND UNKNOWN..Idk
Here is the Script

http://forum.sa-mp.com/showthread.ph...hlight=impound

Join my server 90.216.143.215:7777 And i will show
Reply
#2

Can you show the code where you are detecting if the player is a police officer?
Reply
#3

I am not sure i just know this code
put these under "public OnPlayerCommandText(playerid, cmdtext[])"
pawn Code:
Quote:

dcmd(impound, 7, cmdtext);
dcmd(unimpound, 9, cmdtext);

cmds (put anywhere but not in a callback!):
pawn Code:
Quote:

dcmd_impound(playerid, params[])
{
new engine,lights,alarm,doors,bonnet,boot,objective;
new vid, id, idn[MAX_PLAYER_NAME], n[MAX_PLAYER_NAME], str[288];
id = (strval(params));
GetPlayerName(playerid, n, sizeof(n));
if(!strlen(params)) return SendClientMessage(playerid, 0xFF0000, "USAGE: /impound <playerid>");
if(!IsPlayerInAnyVehicle(id)) return SendClientMessage(playerid, 0xFF0000, "Player Is not in vehicle");
vid = GetPlayerVehicleID(id);
GetPlayerName(id, idn, sizeof(idn));
GetVehicleParamsEx(vid,engine,lights,alarm,doors,b onnet,boot,objective);
SetVehicleParamsEx(vid,0,lights,alarm,doors,bonnet ,boot,objective);
format(str,sizeof(str),"%s has impounded %s's vehicle", n, idn);
SendClientMessageToAll(0x0000FFAA, str);
return 1;
}
dcmd_unimpound(playerid, params[])
{
new engine,lights,alarm,doors,bonnet,boot,objective;
new vid, id, idn[MAX_PLAYER_NAME], n[MAX_PLAYER_NAME], str[245];
id = (strval(params));
GetPlayerName(playerid, n, sizeof(n));
if(!strlen(params)) return SendClientMessage(playerid, 0xFF0000, "USAGE: /unimpound <playerid>");
if(!IsPlayerInAnyVehicle(id)) return SendClientMessage(playerid, 0xFF0000, "Player Is not in vehicle");
vid = GetPlayerVehicleID(id);
GetPlayerName(id, idn, sizeof(idn));
GetVehicleParamsEx(vid,engine,lights,alarm,doors,b onnet,boot,objective);
SetVehicleParamsEx(vid,1,lights,alarm,doors,bonnet ,boot,objective);
format(str, sizeof(str), "%s has unimpounded %s's vehicle", n, idn);
SendClientMessageToAll(0x0000FFAA, str);
return 1;
}

This is all i got here is download link for the script
Reply
#4

Well there is nothing in that script checking what team the players are on. You must be checking it somewhere..

EDIT: Where it says "You must be a police officer to use this command" post the code you are using to check the team they are in.
Reply
#5

Here is download link
Reply
#6

Quote:
Originally Posted by slowride326
Посмотреть сообщение
http://www.mediafire.com/-snip-

Here is download link
I advise you to remove that link unless you want everyone having your script and rcon password.

EDIT: I have had a look at the code and I see it has been converted back to cmdtext rather than dcmd. This was the line I was after:
pawn Код:
if(!IsACop(playerid))return SendClientMessage(playerid,COLOR_WHITE,"You must be a cop to perform this");
It looks fine to me mate and as for the rest of the code it doesn't seem unreachable by the players that are police...

I have heard that GF edits are very difficult to add new features to.
Reply
#7

I think He doesn't have IsACop funtion:
pawn Код:
stock IsACop(killerid)
{
    if(GetPlayerSkin(playerid) == 280 || GetPlayerSkin(playerid) == 281 || GetPlayerSkin(playerid) == 282 || GetPlayerSkin(playerid) == 283 || GetPlayerSkin(playerid) == 284 || GetPlayerSkin(playerid) == 285 || GetPlayerSkin(playerid) == 286 || GetPlayerSkin(playerid) == 287 || GetPlayerSkin(playerid) == 288) {
    return 1;
    }else{
    return 0;
    }
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)