help with vpark
#1

in my when i park my srv its park after srv restart its gone

Код:
CMD:vpark(playerid,params[]) {
	#pragma unused params
	park(playerid);
	return 1;
}
Reply
#2

Show us your park function.
Reply
#3

Код:
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)) {
	//	if((PlayerInfo[playerid][vowner9] == 0) && (PlayerInfo[playerid][vowner10] == 0) && (PlayerInfo[playerid][vowner11] == 0) && (PlayerInfo[playerid][vowner12] == 0) && (PlayerInfo[playerid][vowner13] == 0) && (PlayerInfo[playerid][vowner14] == 0) && (PlayerInfo[playerid][vowner15] == 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;
	}
}
Reply
#4

Load the parked vehicles when server starts by looping.
Reply
#5

how any code...
Reply


Forum Jump:


Users browsing this thread: