21.05.2014, 08:19
(
Последний раз редактировалось AiRaLoKa; 21.05.2014 в 09:12.
)
hi...
i got a problem here, when i tried to type /vehicle [vehicleid], it give me an error. it happened too with /lveh command. Before, it was worked fine, but when i give a lot of vehicle into my server, it's now bugged.
P.S.: i have for about 2000 vehicle in my gamemode
i got a problem here, when i tried to type /vehicle [vehicleid], it give me an error. it happened too with /lveh command. Before, it was worked fine, but when i give a lot of vehicle into my server, it's now bugged.
pawn Код:
CMD:vehicle(playerid, params[])
{
if(IsPlayerInDM(playerid))
{
SendClientMessageLang(playerid, COLOR_RED, ""Err" You cannot spawn vehicle when you are on minigame!", ""Err" Anda tidak bisa menspawn kedaraan saat berada di minigame!");
}
else
{
new Float:x, Float:y, Float:z;
new vehicle = GetVehicleModelIDFromName(params);
if(!strlen(params)) return ShowVehicleDialog(playerid);
if(vehicle < 400 || vehicle > 611) return ShowVehicleDialog(playerid);
new Float:a;
GetPlayerFacingAngle(playerid, a);
GetPlayerPos(playerid, x, y, z);
VehicleSpawner(playerid, vehicle);
/*DestroyVehicle(PlayersVehicle[playerid]);
PlayersVehicle[playerid] = CreateVehicle(vehicle, x, y, z+1, a, -1, -1, -1);
LinkVehicleToInterior(PlayersVehicle[playerid], GetPlayerInterior(playerid));
PutPlayerInVehicle(playerid, PlayersVehicle[playerid], 0);*/
}
return 1;
}
pawn Код:
public VehicleSpawner(playerid,model)
{
if(IsPlayerInAnyVehicle(playerid))
{
new vid = GetPlayerVehicleID(playerid);
DestroyVehicle(vid);
if(VehicleSpawn[playerid]==0)
{
new Float:x,Float:y,Float:z,Float:a;
GetPlayerPos(playerid,x,y,z);
GetPlayerFacingAngle(playerid,a);
DestroyVehicle(PlayersVehicle[playerid]);
PlayersVehicle[playerid] = AddStaticVehicle(model, x, y, z+1, a, -1, -1);
PutPlayerInVehicle(playerid, PlayersVehicle[playerid], 0);
SetVehicleHealth(PlayersVehicle[playerid], 1000.0);
LinkVehicleToInterior(PlayersVehicle[playerid], GetPlayerInterior(playerid));
}
}
else
{
if(VehicleSpawn[playerid]==0)
{
new Float:x,Float:y,Float:z,Float:a;
GetPlayerPos(playerid,x,y,z);
GetPlayerFacingAngle(playerid,a);
DestroyVehicle(PlayersVehicle[playerid]);
PlayersVehicle[playerid] = AddStaticVehicle(model, x, y, z+1, a, -1, -1);
PutPlayerInVehicle(playerid, PlayersVehicle[playerid], 0);
SetVehicleHealth(PlayersVehicle[playerid], 1000.0);
LinkVehicleToInterior(PlayersVehicle[playerid], GetPlayerInterior(playerid));
}
}
return 1;
}
pawn Код:
CMD:lveh(playerid,params[])
{
//new file[256];
//format(file,sizeof(file),"SavedVeh/%s.sav", pName(playerid));
new Query[256];
new rows,fields;
new Float:nx,Float:ny,Float:nz,Float:nrot;
new ID, Model, col1, col2, comp1, comp2, comp3, comp4, comp5, comp6, comp7, comp8, comp9, pj;
mysql_format(dbHandle,Query,sizeof Query,"SELECT * FROM `SavedVeh` WHERE `Name` = '%s'",pName(playerid));
mysql_query(dbHandle,Query);
cache_get_data(rows,fields);
if(rows)
{
GetPlayerPos(playerid, nx, ny, nz);
GetPlayerFacingAngle(playerid, nrot);
ID = cache_get_field_content_int(0,"ID");
DestroyVehicle(PlayerVehicle[ID]);
Model = cache_get_field_content_int(0,"Model");
nrot = cache_get_field_content_float(0,"A");
col1 = cache_get_field_content_int(0,"Col1");
col2 = cache_get_field_content_int(0,"Col2");
comp1 = cache_get_field_content_int(0,"1");
comp2 = cache_get_field_content_int(0,"2");
comp3 = cache_get_field_content_int(0,"3");
comp4 = cache_get_field_content_int(0,"4");
comp5 = cache_get_field_content_int(0,"5");
comp6 = cache_get_field_content_int(0,"6");
comp7 = cache_get_field_content_int(0,"7");
comp8 = cache_get_field_content_int(0,"8");
comp9 = cache_get_field_content_int(0,"9");
pj = cache_get_field_content_int(0,"PJ");
PlayerVehicle[ID]=AddStaticVehicle(Model, nx, ny, nz, nrot, col1, col2);
AddVehicleComponent(PlayerVehicle[ID], comp1);
AddVehicleComponent(PlayerVehicle[ID], comp2);
AddVehicleComponent(PlayerVehicle[ID], comp3);
AddVehicleComponent(PlayerVehicle[ID], comp4);
AddVehicleComponent(PlayerVehicle[ID], comp5);
AddVehicleComponent(PlayerVehicle[ID], comp6);
AddVehicleComponent(PlayerVehicle[ID], comp7);
AddVehicleComponent(PlayerVehicle[ID], comp8);
AddVehicleComponent(PlayerVehicle[ID], comp9);
ChangeVehiclePaintjob(PlayerVehicle[ID], pj);
PutPlayerInVehicle(playerid, PlayerVehicle[ID], 0);
arendaveh[PlayerVehicle[ID]] = playerid;
isarenda[PlayerVehicle[ID]] = 1;
}
else
{
SendClientMessageLang(playerid, 0xFF0000FF, ""Err" You don't have a saved vehicle!", ""Err" Anda tidak memiliki kendaraan pribadi.");
}
return 1;
}