SA-MP Forums Archive
PD Commands. - Impound. - 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: PD Commands. - Impound. (/showthread.php?tid=207738)



PD Commands. - Impound. - iiLiamii - 06.01.2011

Hi I am Looking for impound commands for the PD In My server.

I need the ability to /impound and /unimpound vehicles. once /impound it puts a boot on the ignition and the car should not be able to move at all?

Anyone help?


Re: PD Commands. - Impound. - wilko1995 - 07.01.2011

put these under "public OnPlayerCommandText(playerid, cmdtext[])"
pawn Code:
dcmd(impound, 7, cmdtext);
    dcmd(unimpound, 9, cmdtext);

cmds (put anywhere but not in a callback!):
pawn Code:
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,bonnet,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,bonnet,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;
}
If you need anything modified just ask


Re: PD Commands. - Impound. - zaf13 - 30.01.2012

hey, can u make it to save the car position if the server restart?thanks