Impounding
#1

So i made a litle impound cmd but its not working can ya help me ??

Here is what i added at /engine cmd:
Код:
if(impounded == 1) return SendClientMessage(playerid, COLOR_YELLOW, "Vehicle Is Impounded!");
and here is impounding cmd:
Код:
CMD: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, COLOR_GREY, "USAGE: /impound");
    if(!IsPlayerInAnyVehicle(id)) return SendClientMessage(playerid, COLOR_GREY, "You are not in vehicle");
      if(!IsACop(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You are not an SAPD Oficer.");
    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);
    impounded = 1;
    format(str,sizeof(str),"LSPD officer %s, has impounded a vehicle", n, idn);
    SendClientMessageToAll(COLOR_YELLOW, str);
    return 1;
}
So whats wrong here ??
Reply
#2

impounded is a global variable, try replacing it with
pawn Код:
new impounded[MAX_VEHICLES];
, and then in the CMD:impound do
pawn Код:
impounded[vid] = 1;
at engine
pawn Код:
if(impounded[GetPlayerVehicleID(playerid)])
Reply
#3

Thx but is there a way to save impounded vehicles in scriptfiles ??
Reply
#4

Go check out some tutorials on file savings on Tutorials forum.
Reply
#5

Sory but in tutorials i cant find anything like that
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)