Impounding - 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: Impounding (
/showthread.php?tid=357468)
Impounding -
hulitubolies - 07.07.2012
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 ??
Re: Impounding -
CmZxC - 07.07.2012
impounded is a global variable, try replacing it with
pawn Код:
new impounded[MAX_VEHICLES];
, and then in the CMD:impound do
at engine
pawn Код:
if(impounded[GetPlayerVehicleID(playerid)])
Re: Impounding -
hulitubolies - 07.07.2012
Thx but is there a way to save impounded vehicles in scriptfiles ??
Re: Impounding -
CmZxC - 07.07.2012
Go check out some tutorials on file savings on
Tutorials forum.
Re: Impounding -
hulitubolies - 07.07.2012
Sory but in tutorials i cant find anything like that