PDA

View Full Version : interior laag


s3ek
18/06/2017, 02:12 AM
someone parked cars in interior and now all interior laag.. how i can fix this?

Fairuz
18/06/2017, 06:52 AM
Remove the cars

s3ek
18/06/2017, 05:09 PM
Remove the cars

i can't see cars ... not in map to...!!!

Bingo
18/06/2017, 05:10 PM
i can't see cars ... not in map to...!!!

Then how do you know someone parked the cars?

Astralis
18/06/2017, 05:47 PM
Respawn vehicles? Make a command for that.

AfiqIqbal
18/06/2017, 07:29 PM
Make a variable for the car to destroy whenever the player who spawned the car left the server.

Whatname
18/06/2017, 08:23 PM
for(new i = 0; i < MAX_VEHICLES;i++)
{
if(GetVehicleInterior(i) == 0) continue;
SetVehicleToRespawn(i);
}


also make the player be able to spawn only one car

and as afiqiqbal said destroy his vehicle when he leaves

s3ek
18/06/2017, 08:55 PM
how ican make if player in any interior ... cant use park command..?

stock park(playerid)
{
if(VehicleInfo[GetPlayerVehicleID(playerid)][Temp] == 1) {
return SendClientMessage(playerid, COLOR_ORANGE, "This vehicle is only temporary and some commands may not work!");
}
if(PlayerInfo[playerid][LoggedIn] == 0) {
SendClientMessage(playerid, COLOR_BRIGHTRED, "You must be logged in to use this feature");
return 1;
}
if(PlayerInfo[playerid][Jailed] == 1) {
SendClientMessage(playerid, COLOR_BRIGHTRED, "You are in jail and cannot use this feature");
return 1;
}
if(VehicleInfo[GetPlayerVehicleID(playerid)][buybar] == 1) {
SendClientMessage(playerid, COLOR_BRIGHTRED, "This vehicle is un-buyable and these features will not work!");
return 1;
}
if((PlayerInfo[playerid][vowner] == 0) && (PlayerInfo[playerid][vowner2] == 0) && (PlayerInfo[playerid][vowner3] == 0) && (PlayerInfo[playerid][vowner4] == 0) && (PlayerInfo[playerid][vowner5] == 0) && (PlayerInfo[playerid][vowner6] == 0)) {
if((PlayerInfo[playerid][vowner7] == 0) && (PlayerInfo[playerid][vowner8] == 0)) {
SendClientMessage(playerid, COLOR_BRIGHTRED, "You must first own a vehicle before you can use this feature!");
return 1;
}
}
// if(GetPlayerMoney(playerid) <10000) return SendClientMessage(playerid, COLOR_BRIGHTRED, "You need $10000 to park your car!");
if(IsPlayerInAnyVehicle(playerid)) {
if (strcmp(VehicleInfo[GetPlayerVehicleID(playerid)][owner],PlayerInfo[playerid][name],false) == 0) {
new Float:spx,Float:spy,Float:spz;
new Float:spa;
// GivePlayerMoney(playerid,-10000);
GetVehiclePos(GetPlayerVehicleID(playerid),spx,spy ,spz);
GetVehicleZAngle(GetPlayerVehicleID(playerid),spa) ;
VehicleInfo[GetPlayerVehicleID(playerid)][x_spawn] = spx;
VehicleInfo[GetPlayerVehicleID(playerid)][y_spawn] = spy;
VehicleInfo[GetPlayerVehicleID(playerid)][z_spawn] = spz;
VehicleInfo[GetPlayerVehicleID(playerid)][za_spawn] = spa;
format(securemess,sizeof(securemess),"You have just parked your %s at your current location... it will respawn here in future!", VehicleInfo[GetPlayerVehicleID(playerid)][name]);
SendClientMessage(playerid, COLOR_GREEN, securemess);
return 1;
}
else {
SendClientMessage(playerid, COLOR_BRIGHTRED, "You do not own this vehicle and cannot park it!");
return 1;
}
}
else {
SendClientMessage(playerid, COLOR_BRIGHTRED, "You must be in a vehicle to use this feature");
return 1;
}
}

s3ek
18/06/2017, 09:01 PM
for(new i = 0; i < MAX_VEHICLES;i++)
{
if(GetVehicleInterior(i) == 0) continue;
SetVehicleToRespawn(i);
}


also make the player be able to spawn only one car

and as afiqiqbal said destroy his vehicle when he leaves

sorry i not use mysql..

kalanerik99
18/06/2017, 09:20 PM
sorry i not use mysql..


It isnt mysql it is a basic pawno function... Just put it under some timer or some thing you use in your gamemode so it will check every now and then

kalanerik99
18/06/2017, 09:25 PM
stock park(playerid)
{
if(VehicleInfo[GetPlayerVehicleID(playerid)][Temp] == 1) {
return SendClientMessage(playerid, COLOR_ORANGE, "This vehicle is only temporary and some commands may not work!");
}
if(PlayerInfo[playerid][LoggedIn] == 0) {
SendClientMessage(playerid, COLOR_BRIGHTRED, "You must be logged in to use this feature");
return 1;
}
if(PlayerInfo[playerid][Jailed] == 1) {
SendClientMessage(playerid, COLOR_BRIGHTRED, "You are in jail and cannot use this feature");
return 1;
}
if(GetPlayerInterior(playerid) != 0) return SendClientMessage(playerid, COLOR_BRIGHTRED, "You cannot park vehicles in the interiors!");
if(VehicleInfo[GetPlayerVehicleID(playerid)][buybar] == 1) {
SendClientMessage(playerid, COLOR_BRIGHTRED, "This vehicle is un-buyable and these features will not work!");
return 1;
}
if((PlayerInfo[playerid][vowner] == 0) && (PlayerInfo[playerid][vowner2] == 0) && (PlayerInfo[playerid][vowner3] == 0) && (PlayerInfo[playerid][vowner4] == 0) && (PlayerInfo[playerid][vowner5] == 0) && (PlayerInfo[playerid][vowner6] == 0)) {
if((PlayerInfo[playerid][vowner7] == 0) && (PlayerInfo[playerid][vowner8] == 0)) {
SendClientMessage(playerid, COLOR_BRIGHTRED, "You must first own a vehicle before you can use this feature!");
return 1;
}
}
// if(GetPlayerMoney(playerid) <10000) return SendClientMessage(playerid, COLOR_BRIGHTRED, "You need $10000 to park your car!");
if(IsPlayerInAnyVehicle(playerid)) {
if (strcmp(VehicleInfo[GetPlayerVehicleID(playerid)][owner],PlayerInfo[playerid][name],false) == 0) {
new Float:spx,Float:spy,Float:spz;
new Float:spa;
// GivePlayerMoney(playerid,-10000);
GetVehiclePos(GetPlayerVehicleID(playerid),spx,spy ,spz);
GetVehicleZAngle(GetPlayerVehicleID(playerid),spa) ;
VehicleInfo[GetPlayerVehicleID(playerid)][x_spawn] = spx;
VehicleInfo[GetPlayerVehicleID(playerid)][y_spawn] = spy;
VehicleInfo[GetPlayerVehicleID(playerid)][z_spawn] = spz;
VehicleInfo[GetPlayerVehicleID(playerid)][za_spawn] = spa;
format(securemess,sizeof(securemess),"You have just parked your %s at your current location... it will respawn here in future!", VehicleInfo[GetPlayerVehicleID(playerid)][name]);
SendClientMessage(playerid, COLOR_GREEN, securemess);
return 1;
}
else {
SendClientMessage(playerid, COLOR_BRIGHTRED, "You do not own this vehicle and cannot park it!");
return 1;
}
}
else {
SendClientMessage(playerid, COLOR_BRIGHTRED, "You must be in a vehicle to use this feature");
return 1;
}
}

This should work I think

s3ek
19/06/2017, 01:00 AM
stock park(playerid)
{
if(VehicleInfo[GetPlayerVehicleID(playerid)][Temp] == 1) {
return SendClientMessage(playerid, COLOR_ORANGE, "This vehicle is only temporary and some commands may not work!");
}
if(PlayerInfo[playerid][LoggedIn] == 0) {
SendClientMessage(playerid, COLOR_BRIGHTRED, "You must be logged in to use this feature");
return 1;
}
if(PlayerInfo[playerid][Jailed] == 1) {
SendClientMessage(playerid, COLOR_BRIGHTRED, "You are in jail and cannot use this feature");
return 1;
}
if(GetPlayerInterior(playerid) != 0) return SendClientMessage(playerid, COLOR_BRIGHTRED, "You cannot park vehicles in the interiors!");
if(VehicleInfo[GetPlayerVehicleID(playerid)][buybar] == 1) {
SendClientMessage(playerid, COLOR_BRIGHTRED, "This vehicle is un-buyable and these features will not work!");
return 1;
}
if((PlayerInfo[playerid][vowner] == 0) && (PlayerInfo[playerid][vowner2] == 0) && (PlayerInfo[playerid][vowner3] == 0) && (PlayerInfo[playerid][vowner4] == 0) && (PlayerInfo[playerid][vowner5] == 0) && (PlayerInfo[playerid][vowner6] == 0)) {
if((PlayerInfo[playerid][vowner7] == 0) && (PlayerInfo[playerid][vowner8] == 0)) {
SendClientMessage(playerid, COLOR_BRIGHTRED, "You must first own a vehicle before you can use this feature!");
return 1;
}
}
// if(GetPlayerMoney(playerid) <10000) return SendClientMessage(playerid, COLOR_BRIGHTRED, "You need $10000 to park your car!");
if(IsPlayerInAnyVehicle(playerid)) {
if (strcmp(VehicleInfo[GetPlayerVehicleID(playerid)][owner],PlayerInfo[playerid][name],false) == 0) {
new Float:spx,Float:spy,Float:spz;
new Float:spa;
// GivePlayerMoney(playerid,-10000);
GetVehiclePos(GetPlayerVehicleID(playerid),spx,spy ,spz);
GetVehicleZAngle(GetPlayerVehicleID(playerid),spa) ;
VehicleInfo[GetPlayerVehicleID(playerid)][x_spawn] = spx;
VehicleInfo[GetPlayerVehicleID(playerid)][y_spawn] = spy;
VehicleInfo[GetPlayerVehicleID(playerid)][z_spawn] = spz;
VehicleInfo[GetPlayerVehicleID(playerid)][za_spawn] = spa;
format(securemess,sizeof(securemess),"You have just parked your %s at your current location... it will respawn here in future!", VehicleInfo[GetPlayerVehicleID(playerid)][name]);
SendClientMessage(playerid, COLOR_GREEN, securemess);
return 1;
}
else {
SendClientMessage(playerid, COLOR_BRIGHTRED, "You do not own this vehicle and cannot park it!");
return 1;
}
}
else {
SendClientMessage(playerid, COLOR_BRIGHTRED, "You must be in a vehicle to use this feature");
return 1;
}
}

This should work I think

this work thank you .... but i need to know ids cars already parked in interiors.. for fix laaag pleas help me

Kane
19/06/2017, 01:27 AM
I don't see how cars in an interior lag you. What happens when you "lag"?

s3ek
19/06/2017, 02:19 AM
I don't see how cars in an interior lag you. What happens when you "lag"?

all players can't go to interiors because very lag .. if i respawn cars ..interior fast 5 sec and back laag again... cars is invisible in interiors