Help me please. -
pawn Код:
stock SaveImpounded()
{
new idx = 0, File:file;
new string[256];
while(idx < MAX_IMPOUNDED)
{
format(string, sizeof(string), "%d|%d",
ImpoundedInfo[idx][pVeh],
ImpoundedInfo[idx][pImpounded],
if(idx == 0)
{
file = fopen("Impounded.cfg", io_write);
}
else
{
file = fopen("Impounded.cfg", io_append);
}
fwrite(file, string);
fclose(file);
idx++;
}
print("Impounded saved successfully.");
}
stock LoadImpounded()
{
new dinfo[7][128];
new string[256];
new File:file = fopen("Impounded.cfg", io_read);
if(file)
{
new idx = 0;
while(idx < MAX_IMPOUNDED)
{
fread(file, string);
split(string, dinfo, '|');
ImpoundedInfo[idx][pVeh] = strval(dinfo[1]);
ImpoundedInfo[idx][Impounded] = strval(dinfo[2]);
idx++;
}
}
print("Impounded loaded successfully.");
return 1;
}
[MAX_VEHICLES];
pawn Код:
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(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
if(!IsPlayerInAnyVehicle(id)) return SendClientMessage(playerid, COLOR_GREY, "You are not in vehicle");
if(!IsALSR(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You are not an LSR Member.");
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[vid] = 1;
format(str,sizeof(str),"%s Takes out a notepad and writes car in impounded list.", n, idn);
SendClientMessageToAll(COLOR_PURPLE, str);
return 1;
}
CMD: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, COLOR_GREY, "USAGE: /unimpound");
if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
if(!IsPlayerInAnyVehicle(id)) return SendClientMessage(playerid, COLOR_GREY, "You are not in vehicle");
if(!IsALSR(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You are not an LSR Member.");
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);
impounded[vid] = 0;
format(str, sizeof(str), "%s Takes out a notepad and writes car in unimpounded list.", n, idn);
SendClientMessageToAll(COLOR_PURPLE, str);
return 1;
}[MAX_VEHICLES];
Re: Help me please. -
Re: Help me please. -
Re: Help me please. -
pawn Код:
stock SaveImpounded()
{
new idx = 0, File:file;
new string[256];
while(idx < MAX_IMPOUNDED)
{
2373 format(string, sizeof(string), "%d|%d",
2374 ImpoundedInfo[idx][pVeh],
2375 ImpoundedInfo[idx][pImpounded],
if(idx == 0)
{
file = fopen("Impounded.cfg", io_write);
}
else
{
file = fopen("Impounded.cfg", io_append);
}
fwrite(file, string);
fclose(file);
idx++;
}
print("Impounded saved successfully.");
}
This fixed.
Re: Help me please. -
Re: Help me please. -
Re: Help me please. -
Re: Help me please. -
Re: Help me please. -
Re: Help me please. -